home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / blkos207.zip / ALARM.CMD next >
OS/2 REXX Batch file  |  1993-05-11  |  1KB  |  45 lines

  1. /*ALARM.CMD*/
  2. /*copyright (c)C>BLACK,B.STONE,KUTEK 1993*/
  3. /* all rights reserved*/
  4. /* not for public release*/
  5. /* CRON pgm sounds an alarm or starts a pgm at a set time*/
  6. /* usage: ALARM<alarm time> <optional command and parameters>*/
  7. /*time in form of number using 24 hour format as follows*/
  8. /* 5PM is 170000,3:20AM is 032000*/
  9. parse arg   x.2  x.3  x.4  x.5  x.6  x.7 x.8 x.9
  10. say x.2 'ALARM TIME'
  11. xxwq=  x.3 x.4 x.5 x.6 x.7 x.8 x.9
  12. stime=time()
  13. parse var stime xx':'yy':'zz
  14. stt=(xx)(yy)(zz)
  15. say stt 'start time'
  16. std=date('S')
  17. say std 'start date'
  18. if x.2<stt then adate=std+1
  19. else adate=std
  20. say adate 'active date'
  21. do forever
  22.    s=time()
  23.   nd=date('S')
  24. parse var s aaa':'bb':'cc
  25. nt=(aaa)(bb)cc
  26. parse value syscurpos() with row col
  27. say s nd x2c(1b)'[1;32mCOUNTDOWN TIME'x2c(1b)'[0m'
  28. qq=syscurpos(row,col)
  29. if adate\=std &nd=adate&nt>x.2 then call ring
  30. if adate=std&nt>x.2 then call ring
  31. else call syssleep 20
  32. end 
  33.  
  34.  
  35. ring:
  36. if x.3='' then do 50
  37. call beep 2500,35
  38. call beep 2000,35
  39. end
  40. else do
  41. xxwq=strip(xxwq)
  42. 'start /c' xxwq;end
  43. call syssleep 10
  44.  
  45.