home *** CD-ROM | disk | FTP | other *** search
- /* this sets up a reminder file */
-
- call MenuWindow(REMINDERHOST,REMINDERPORT)
-
- text = " Date:\\ Time:\\Message:\\\\\\\\\\"
-
- call WindowText(REMINDERHOST,text)
- call AddGadget(REMINDERHOST,90,17,"DATE"," ","%d%1%g",500)
- call AddGadget(REMINDERHOST,90,35,"TIME"," ","%d%1%g",500)
- call AddGadget(REMINDERHOST,90,53,"MES1"," ","%d%1%g",500)
- call AddGadget(REMINDERHOST,90,71,"MES2"," ","%d%1%g",500)
- call AddGadget(REMINDERHOST,90,89,"MES3"," ","%d%1%g",500)
- call AddGadget(REMINDERHOST,90,107,"MES4"," ","%d%1%g",500)
- call AddGadget(REMINDERHOST,90,150,"NAG","\ Nag Me \","%d%1%d")
- call AddGadget(REMINDERHOST,474,150,"ADD","\ Add Reminder \","%d%1%d")
- quitflag = 0
-
- call ActivateGadget(REMINDERHOST,"DATE")
-
- nag = 0
- do forever
- if quitflag = 1 then leave
- t = waitpkt(REMINDERPORT)
- do ff = 1
- p = getpkt(REMINDERPORT)
- if c2d(p) = 0 then leave ff
-
- command = getarg(p)
-
- if command ~= "CLOSEWINDOW" then text = getarg(p,1)
- t = reply(p, 0)
- select
- when command = CLOSEWINDOW then do
- call CloseWindow(REMINDERHOST)
- quitflag = 1
- end
- when command = "ADD" then do
- call WriteFile()
- "runwsh remind "date time nag message
- end
- when command = "DATE" then call ActivateGadget(REMINDERHOST,"TIME")
- when command = "TIME" then call ActivateGadget(REMINDERHOST,"MES1")
- when command = "MES1" then call ActivateGadget(REMINDERHOST,"MES2")
- when command = "MES2" then call ActivateGadget(REMINDERHOST,"MES3")
- when command = "MES3" then call ActivateGadget(REMINDERHOST,"MES4")
- when command = "MES4" then call ActivateGadget(REMINDERHOST,"DATE")
- when command = "NAG" then nag = 1
- otherwise say command
- end
-
- end
- end
-
- exit
-
- /* MenuWindow.rexx - menu making function */
-
- MenuWindow:
- arg menuhost, menuport
-
- runwsh "'x=createhost("menuhost||","||menuport||")'"
- mp = openport(menuport)
- do i = 1 to 2
- address command 'c:WaitForPort 'menuhost
- address command 'c:WaitForPort 'menuport
- xx=showlist('p',menuhost)
- yy=showlist('p',menuport)
- if xx & yy then leave i
- end
-
- idcmp = 'CLOSEWINDOW+GADGETUP'
- flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+BACKFILL+ACTIVATE'
-
- call OpenWindow(menuhost,10,10,screencols()-40,200,idcmp, flags)
-
-
- return 0
-
- /* GetVar.rexx */
-
- GetVar:
- parse arg menuhost, menuport, gadgetname
- call ReadGadget(menuhost,gadgetname)
- t = waitpkt(menuport)
- p = getpkt(menuport)
- string = getarg(p,1)
- t = reply(p,0)
- string = strip(string)
- return string
-
- WriteFile:
-
- arg filename, type
-
- date = GetVar(REMINDERHOST,REMINDERPORT,"DATE")
- time = GetVar(REMINDERHOST,REMINDERPORT,"TIME")
- mes1 = GetVar(REMINDERHOST,REMINDERPORT,"MES1")
- mes2 = GetVar(REMINDERHOST,REMINDERPORT,"MES2")
- mes3 = GetVar(REMINDERHOST,REMINDERPORT,"MES3")
- mes4 = GetVar(REMINDERHOST,REMINDERPORT,"MES4")
-
- date = strip(date); time = strip(time);
-
- checkdate = "hd:reminders/"date||"*"
- 'list hd:reminders/'date'* | execio stem file.'
- lastfile = file.0-1
- if lastfile > 0 then do
- parse var file.lastfile date'%'nextfile .
- nextfile = nextfile + 1
- end
- else nextfile = 1
- file = date"%"||nextfile
- file = "hd:reminders/"file
-
- checkfile = open(outfile,file,'W')
-
- if checkfile = 0 then return 10
- call writeln(outfile,"date = '"date"'")
- call writeln(outfile,"time = '"time"'")
- call writeln(outfile,"nag = "nag)
- call writeln(outfile,'message = "'mes1'"')
- message = mes1
- if mes2 ~= "" then do
- call writeln(outfile,'message = message||"\"||"'mes2'"')
- message = message||"\"||mes2
- end
- if mes3 ~= "" then do
- call writeln(outfile,'message = message||"\"||"'mes3'"')
- message = message||"\"||mes3
- end
- if mes4 ~= "" then do
- call writeln(outfile,'message = message||"\"||"'mes4'"')
- message = message||"\"||mes4
- end
- call close(outfile)
- return
-