The first check I make after the scan is whether the template <1...an empty scan. When I start the frontend if I hit enter with no data everything works fine. Then I scan data, it's processed and produces a label. If I scan the same data or a new label series instead of processing the data I get the "empty scan" error message.
Guess what I'm needed to happen is after I process a shipping or other label and I return to the top that all variables are zeroed and the show dialog starts over fresh...but I obviously have something out of sync...could use some more experienced eyes to tell me what I'm missing. Thanks
Code: Select all
Let>APP_TITLE=Tattoo Frontend
VBSTART
Function GetFileCreatedInfo(filespec)
Dim fso, f, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(filespec)
s = f.DateLastModified
' you could use s = f.DateLastAccessed
' or s = f.DateLastModified
GetFileCreatedInfo = s
End Function
VBEND
Dialog>Dialog1
Caption=Tattoo Front End
Width=405
Height=217
Top=507
Left=395
Label=Scan Your Card Now !!,24,64,true
Edit=msEdit1,24,88,345,
Button=Ok,120,136,75,25,2
Default=Ok
EndDialog>Dialog1
LABEL>CHECKTATTOO
Let>WF_TYPE=1
IfWindowOpen>- print by design*,STARTSCAN
LABEL>STARTUP
LET>RP_WINDOWMODE=0
RUN PROGRAM>C:\Program Files\ISD\Print By Design\PBD.cmd
WaitWindowOpen>- print by design*
ReadIniFile>c:\frontend\frontend.ini,settings,PbdOpen,Pbd
WAIT>%Pbd%
GOTO>CHECKTATTOO
LABEL>STARTSCAN
Let>TEMPLATE=
LET>BTR=
LET>COPIES=
LET>LABELS=
LET>scan_part_1=
LET>scan_part_2=
LET>scan_part_3=
LET>scan_part_4=
LET>scan=
Show>Dialog1
Label>startin
GetDialogAction>Dialog1,r1
If>r1=2,endin
Wait>0.0001
WindowAction>0,Tattoo Front End
Goto>startin
Label>endin
Let>SCAN=%Dialog1.msEdit1%
WindowAction>3,Tattoo Front End
Let>comma=,
Separate>%SCAN%,comma,scan_part
Let>TEMPLATE=%scan_part_1%
Let>BTR=%scan_part_2%
Let>COPIES=%scan_part_3%
Let>LABELS=%scan_part_4%
wait>.1
CloseDialog>Dialog1
if>%TEMPLATE%<1>Dialog1*/
Day>the_day
Month>the_month
Year>the_year
Hour>HR
Min>Mn
Let>NOW=%the_year%%the_month%%the_day%%HR%%Mn%
Let>WF_TYPE=1
IfWindowOpen>- print by design*,TEMPLTEST
LET>RP_WINDOWMODE=0
RUN PROGRAM>C:\Program Files\ISD\Print By Design\PBD.cmd
WaitWindowOpen>- print by design*
ReadIniFile>c:\frontend\frontend.ini,settings,PbdOpen,Pbd
WAIT>%Pbd%
LABEL>TEMPLTEST
Let>k=1
LABEL>READTEMPLATE
ReadLn>C:\FRONTEND\TEMPLATE.TXT,k,LINE
If>line=##EOF##,BADTEMPL
IF>%LINE%=%TEMPLATE%,LABELTYPE
Let>k=k+1
Goto>READTEMPLATE
LABEL>LABELTYPE
Let>k=1
LABEL>READXLB
ReadLn>C:\FRONTEND\XLB.TXT,k,LINE
If>line=##EOF##,SHIPPRINT
IF>%LINE%=%TEMPLATE%,XLBPRINT
Let>k=k+1
Goto>READXLB
LABEL>SHIPPRINT
ReadIniFile>c:\frontend\frontend.ini,settings,%BTR%,oldtime
Let>NEWTIME=%NOW%
If>%oldtime%<1>YESBTR
LABEL>NOBTR
WRITELN>C:\FRONTEND\FRONTEND.INI,%BTR%=%NOW%
GOTO>SHIPLABEL
LABEL>YESBTR
IF>NEWTIME<OLDTIME>DIF=5
GOTO>SORRYCHARLIE1
LABEL>YESBTR1
Let>DIF2=%NEWTIME%-%OLDTIME%
IF>%DIF2%<5>SHIPLABEL
Let>WF_TYPE=1
IfWindowOpen>- print by design*,SHIP2
LET>RP_WINDOWMODE=0
RUN PROGRAM>C:\Program Files\ISD\Print By Design\PBD.cmd
WaitWindowOpen>- print by design*
ReadIniFile>c:\frontend\frontend.ini,settings,PbdOpen,Pbd
WAIT>%Pbd%
LABEL>SHIP2
EditIniFile>C:\FRONTEND\FRONTEND.INI,settings,%BTR%,%NOW%
WindowAction>1,- print by design*
setfocus>- print by design*
ReadIniFile>c:\frontend\frontend.ini,shipping,PbdOpen,Pbd
WAIT>%Pbd%
ReadIniFile>c:\frontend\frontend.ini,settings,fip,fip_1
Let>FIP_SCANPIXELS=%fip_1%
ReadIniFile>c:\frontend\frontend.ini,settings,colort,color_t
FindImagePos>C:\FRONTEND\CLEAR.BMP,SCREEN,%color_t%,1,XPS,YPS,NumFound
MouseMove>%XPS_0%,%YPS_0%
LClick
ReadIniFile>c:\frontend\frontend.ini,shipping,MouseClear,MouseC
WAIT>%MouseC%
Send>%TEMPLATE%
Press DOWN
ReadIniFile>c:\frontend\frontend.ini,shipping,TemplateWait,TempWait
WAIT>%TempWait%
Send>%BTR%%CR%
ReadIniFile>c:\frontend\frontend.ini,shipping,PnWait,Pnw
WAIT>%Pnw%
send>%COPIES%%CR%
ReadIniFile>c:\frontend\frontend.ini,shipping,CopiesWait,CopW
WAIT>%CopW%
send>%LABELS%%CR%
ReadIniFile>c:\frontend\frontend.ini,shipping,LabelsWait,LabW
WAIT>%LabW%
send>%CR%
ReadIniFile>c:\frontend\frontend.ini,shipping,PrintersWait,PrnW
WAIT>%PrnW%
send>%CR%
ReadIniFile>c:\frontend\frontend.ini,shipping,PrintWait,PntW
WAIT>%PntW%
WindowAction>2,- print by design*
Let>%Dialog1.msEdit1%=
IfFileExists>L:\btr_current\db1.mdb,cdbcheck
WRITELN>C:\FRONTEND\tattoo.log,%NOW% Could not read from the L drive
wait>.5
GOTO>CHECKTATTOO
Label>cdbcheck
IfFileExists>c:\btr_current\db1.mdb,dbcheck
goto>checkpbd
Label>dbcheck
VBEVAL>GetFileCreatedInfo("c:\btr_current\db1.mdb"),localdate
VBEVAL>GetFileCreatedInfo("L:\btr_current\db1.mdb"),netdate
if>netdate<localdate>.5
GOTO>CHECKTATTOO
label>checkpbd
IfWindowOpen>- print by design*,shutdown
goto>copynow
label>shutdown
setfocus>- print by design*
WaitWindowOpen>- print by design*
press alt
press f4
release alt
wait>3
goto>checkpbd
label>copynow
wait>2
Let>CF_OVERWRITE=1
let>file1=cmd.exe /c copy L:\btr_current\db1.mdb
let>file2=c:\btr_current\db1.mdb
let>RP_WINDOWMODE=0
let>RP_WAIT=1
Run Program>%file1%, %file2%
wait>.5
GOTO>CHECKTATTOO
Label>XLBPRINT
Let>WF_TYPE=1
IfWindowOpen>- print by design*,XLBPRINT2
RUN PROGRAM>C:\Program Files\ISD\Print By Design\PBD.cmd
WaitWindowOpen>- print by design*
ReadIniFile>c:\frontend\frontend.ini,settings,PbdOpen,Pbd
WAIT>%Pbd%
LABEL>XLBPRINT2
WindowAction>1,- print by design*
setfocus>- print by design*
ReadIniFile>c:\frontend\frontend.ini,xlb,PbdOpen,PbdO
WAIT>%PbdO%
ReadIniFile>c:\frontend\frontend.ini,settings,fip,fip_1
Let>FIP_SCANPIXELS=%fip_1%
ReadIniFile>c:\frontend\frontend.ini,settings,colort,color_t
FindImagePos>C:\FRONTEND\CLEAR.BMP,SCREEN,%color_t%,1,XPS,YPS,NumFound
MouseMove>%XPS_0%,%YPS_0%
LClick
ReadIniFile>c:\frontend\frontend.ini,xlb,MouseClear,MouC
WAIT>%MouC%
Send>%TEMPLATE%
Press DOWN
ReadIniFile>c:\frontend\frontend.ini,xlb,TemplateWait,TempW
WAIT>%TempW%
Send>%COPIES%%CR%
ReadIniFile>c:\frontend\frontend.ini,xlb,CopiesWait,CopW
WAIT>%CopW%
send>%LABELS%%CR%
ReadIniFile>c:\frontend\frontend.ini,xlb,LabelsWait,LabWt
WAIT>%LabWt%
send>%CR%
ReadIniFile>c:\frontend\frontend.ini,xlb,PrintersWait,PrnsW
WAIT>%PrnsW%
send>%CR%
ReadIniFile>c:\frontend\frontend.ini,xlb,PrintWait,PntWt
WAIT>%PntWt%
WindowAction>2,- print by design*
IfFileExists>L:\btr_current\db1.mdb,dbcheck2
WRITELN>C:\FRONTEND\tattoo.log,%NOW% Could not read from the L drive
wait>.5
GOTO>CHECKTATTOO
Label>dbcheck2
IfFileExists>C:\btr_current\db1.mdb,FILEEVAL2
goto>checkpbd2
LABEL>FILEEVAL2
VBEVAL>GetFileCreatedInfo("c:\btr_current\db1.mdb"),localdate
VBEVAL>GetFileCreatedInfo("L:\btr_current\db1.mdb"),netdate
if>netdate<localdate>.5
GOTO>CHECKTATTOO
label>checkpbd2
IfWindowOpen>- print by design*,shutdown2
goto>copynow2
label>shutdown2
setfocus>- print by design*
WaitWindowOpen>- print by design*
press alt
press f4
release alt
wait>3
goto>checkpbd2
label>copynow2
wait>2
Let>CF_OVERWRITE=1
let>file1=cmd.exe /c copy L:\btr_current\db1.mdb
let>file2=c:\btr_current\db1.mdb
let>RP_WINDOWMODE=0
let>RP_WAIT=1
Run Program>%file1%, %file2%
wait>.5
GOTO>CHECKTATTOO
LABEL>SORRYCHARLIE
LET>DIF=5-%DIF2%
LABEL>SORRYCHARLIE1
MESSAGE>You must wait %DIF% minute(s)before you can print this part number again.
LET>DIF=
GOTO>MSG
LABEL>BADSCAN
MESSAGE>The scan was bad, please try again.
GOTO>MSG
LABEL>BADTEMPL
MESSAGE>This scan card does not work on this label station.%CRLF%%CRLF%Contact your supervisor%CRLF%%CRLF% %TEMPLATE%%CRLF%
WAIT>3
GOTO>MSG
LABEL>MSG
wait>7
Let>WF_TYPE=1
WindowAction>3,Tattoo Frontend Mess*
wait>.5
Let>Dialog1.msEdit1=
ResetDialogAction>Dialog1
wait>.2
GOTO>CHECKTATTOO