home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 616.lha / Notify_v1.01 / NotifyNoise < prev    next >
Text File  |  1992-02-21  |  2KB  |  79 lines

  1. /* NotifyNoise 1.01 */
  2. /* Copyright © Michael Tanzer, 1991, 1992 */
  3. /* See additional notices in accompanying documentation */
  4.  
  5. twentyfour = 0                /* 0 = 12-hour noise; 1 = 24-hour noise */
  6.  
  7. /* Build time table */
  8. t.0  = 'twelve'
  9. t.1  = 'one'
  10. t.2  = 'two'
  11. t.3  = 'three'
  12. t.4  = 'four'
  13. t.5  = 'five'
  14. t.6  = 'six'
  15. t.7  = 'seven'
  16. t.8  = 'eight'
  17. t.9  = 'nine'
  18. t.10 = 'ten'
  19. t.11 = 'elevven'
  20. t.12 = 'twelve'
  21. t.13 = 'thir teen'
  22. t.14 = 'four teen'
  23. t.15 = 'fif teen'
  24. t.16 = 'six teen'
  25. t.17 = 'seven teen'
  26. t.18 = 'ay teen'
  27. t.19 = 'nine teen'
  28. t.20 = 'twenty'
  29. t.30 = 'thirty'
  30. t.40 = 'forty'
  31. t.50 = 'fifty'
  32.  
  33. parse arg time message
  34. parse var time hh':'mm
  35. if ~datatype(hh,'W') | ~datatype(mm,'W') then call error
  36. if hh<0 | hh>23 then call error
  37. if mm<0 | mm>59 then call error
  38.  
  39. /* Get hour */
  40. if twentyfour then do
  41.   hh = hh+0
  42.   select
  43.     when hh=0 then hour = 'zeerow'
  44.     when hh<10 then hour = 'o' t.hh
  45.     when hh<21 then hour = t.hh
  46.     otherwise interpret 'hour = ''twenty'' t.'substr(hh,2)
  47.     end
  48.   end
  49. else interpret 'hour = t.'hh//12
  50.  
  51. /* Get minute */
  52. mm = mm+0
  53. select
  54.   when mm=0 then do
  55.     if twentyfour then minute = 'hundredh'
  56.     else minute = 'owclock'
  57.     end
  58.   when mm<10 then do
  59.     if twentyfour then minute = 'o' t.mm
  60.     else minute = t.mm
  61.     end
  62.   when mm<21 then minute = t.mm
  63.   otherwise do
  64.     interpret 'minute = t.'substr(mm,1,1)'0'
  65.     w = substr(mm,2)
  66.     if w>0 then interpret 'minute = minute t.'w
  67.     end
  68.   end
  69.  
  70. /* Make some noise */
  71. text = 'it is now' hour',' minute'.' translate(message,' ','\')
  72. address command 'sys:utilities/say' text
  73. exit
  74.  
  75. /* Handle invalid time */
  76. error:
  77.   address command 'sys:utilities/say invalid time specified.'
  78.   exit
  79.