Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Job Manager Example

Keywords: 	 Job Manager Example add remove

;Note.  This code uses a trick making it non-compilable with the WinBatch Compiler
goto top
[Jobs]

Software List=notepad.exe,d:\Admins\Software.txt
S/N's=notepad.exe,d:\Admins\serials.txt
People's Info=notepad.exe,d:\Admins\People.txt
Temp=notepad.exe,d:\Admins\Temp.txt
Notes=notepad.exe,d:\Admins\Notes.txt
Web Sites/FTP=notepad.exe,d:\Admins\Web.txt
WinBatch Notes=notepad.exe,d:\Admins\WinBatch.txt
WinBatch.exe=C:\Program Files\WinBatch\SYSTEM\Winbat~1.exe,
Hotmail=D:\My Docs\Cool\!Passw~1.wbt,





[Dummy]
:top
IntControl(62, -2 ,0 ,0 ,0)
THISWBTFILE=IntControl(1004,0,0,0,0)
gosub getlist


while 1
templist=list

MyDialogFormat=`WWWDLGED,5.0`

MyDialogCaption=`WIL Dialog`
MyDialogX=58
MyDialogY=108
MyDialogWidth=152
MyDialogHeight=188
MyDialogNumControls=5

MyDialog01=`8,11,134,128,ITEMBOX,templist,DEFAULT`
MyDialog02=`11,142,51,DEFAULT,PUSHBUTTON,DEFAULT,"&Open",1`
MyDialog03=`86,142,51,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
MyDialog04=`11,163,51,DEFAULT,PUSHBUTTON,DEFAULT,"&Add",2`
MyDialog05=`86,163,51,DEFAULT,PUSHBUTTON,DEFAULT,"&Remove",3`

ButtonPushed=Dialog("MyDialog")

switch ButtonPushed

case 1    ; OPEN pushed
gosub DoOpen
break

case 2    ; gosub Add
gosub DoAdd
break

case 3
gosub  DoRemove
break

endswitch


EndWhile
exit

;;;;;;;;;;;;;;; SUBROUTINES;;;;;;;;;;;;;;;;;;;;;;
:DoAdd
newTitle=AskLine("JobManager","Enter title of job","")
newjob=AskLine("JobManager","Enter command line (with comma!)","notepad.exe, c:\xxx.txt")
IniWritePvt("Jobs",newtitle,newjob,THISWBTFILE)
gosub getlist
return

:DoRemove
count=ItemCount(templist,@tab)
for xx=1 to count
thisitem=ItemExtract(xx,templist,@tab)
IniDeletePvt("Jobs",thisitem,THISWBTFILE)
next
gosub getlist
return

:DoOpen
count=ItemCount(templist,@tab)
for xx=1 to count
thisitem=ItemExtract(xx,templist,@tab)
linedata=IniReadPvt("Jobs",thisitem,0,THISWBTFILE)
if linedata==0 then continue
thisexe=ItemExtract(1,linedata,",")
thisparam=ItemExtract(2,linedata,",")
Run(thisexe,thisparam)
next
return

:GetList
list=IniItemizePvt("Jobs",THISWBTFILE)
return


Article ID:   W14293
Filename:   Job Manager Example.txt