home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / modem / schedule.mex < prev    next >
Encoding:
Text File  |  1993-06-08  |  1.9 KB  |  67 lines

  1. screen off;stat silent on;screen on
  2. .
  3. . SCHEDULE.MEX
  4. . This MEX script prompts for a time to execute a command.  While
  5. . WAIT STRING could be used to do effectively the same thing, no
  6. . processing can be done during the waiting period with WAIT STRING.
  7. . This script illustrates a technique useable for updating the display
  8. . (in this case, just the time of day) during the wait period.  It
  9. . also illustrates programmatic access of the time of day (note that
  10. . it requires a real-time clock, which is available in MSDOS systems
  11. . and MEX-PC, but not necessarily in all CP/M systems and MexPlus).
  12. .
  13. . Written by Ron Fowler, NightOwl Software, Inc.   06-12-1986
  14. .
  15. Cls
  16. Box 0,0,10,79
  17. @ 3,27;Start rev;say " M E X   S C H E D U L E R ";End rev
  18. @ 5,5 Say " This script will execute a MEX command at a scheduled time."
  19. Start brite
  20. @ 6,5 Say " NOTE: you must use military standard time! "
  21. @ 7,5 Say "      That means 1:55 pm is 13:55 and 12:05 am is 00:05."
  22. Gosub TIMEBOX
  23. @ 9,5 Say " Enter a command to be executed: "
  24. Accept a
  25. @ 9,5 Say "                                                                 "
  26. Gosub TIMEBOX
  27. @ 9,5 Say " Enter hours: "
  28. Input
  29. %x=value
  30. @ 9,5 Say "                     "
  31. Gosub TIMEBOX
  32. @ 9,5 Say " Enter minutes: "
  33. Input
  34. @ 9,5 Say "                     "
  35. %y=value
  36. @ 9,5 Say " Waiting for ",%x,":",%y
  37. Gosub TIMEBOX
  38. @ 9,22
  39. Label WTIME
  40. Sleep 5
  41. Gosub TIMEBOX
  42. @ 9,22
  43. Gosub GETTIME
  44. If %h<>%x Then Goto WTIME;.jump if not correct hour
  45. If %m<%y Then  Goto WTIME;.jump if < correct minute
  46. @12,0
  47. {a}
  48. stop
  49. .
  50. Proc TIMEBOX
  51.   @1,57
  52.   Gosub GETTIME
  53.   Start Rev
  54.   Say " Current time: "
  55.   Say %h,":",%m
  56.   End Rev
  57. Endp
  58. Proc GETTIME            ;.get time into %h (hrs) and %m (minutes)
  59.    Screen Off            ;.read time into VALUE
  60.       Time
  61.    Screen On
  62.    %h=value/256            ;. %H=hours
  63.    And 255            ;. isolate minutes in VALUE
  64.    %m=value            ;. %M=minutes
  65. Endp
  66. ime
  67.    Scree