home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / REXXCH03.ZIP / TWELVDAY.CMD < prev   
OS/2 REXX Batch file  |  1991-03-11  |  982b  |  37 lines

  1. /* What my true love sent ... */
  2.  
  3. /* first assign the gifts to the days */
  4. gift.1  = 'A partridge in a pear tree'
  5. gift.2  = 'Two turtle doves'
  6. gift.3  = 'Three French hens'
  7. gift.4  = 'Four calling birds'
  8. gift.5  = 'Five golden rings'
  9. gift.6  = 'Six geese a-laying'
  10. gift.7  = 'Seven swans a-swimming'
  11. gift.8  = 'Eight maids a-milking'
  12. gift.9  = 'Nine ladies dancing'
  13. gift.10 = 'Ten lords a-leaping'
  14. gift.11 = 'Eleven pipers piping'
  15. gift.12 = 'Twleve drummers drumming'
  16.  
  17. /* list all gifts from the 12th day to   */
  18. /* the 1st day; refer to the discussion  */
  19. /* of loops on page 6-11.                */
  20. do day=12 to 1
  21.   say gift.day
  22. end
  23.  
  24. /* now display the gift for a chosen day */
  25. say "Type a number from 1 to 12."
  26. pull day
  27.  
  28. /* check for proper input */
  29. /* see page 9-1           */
  30. if \ datatype(day,n) then       /* if the entry is not a number */
  31.   exit
  32.  
  33. if day < 1 | day > 12 then      /* same if it is out of range   */
  34.   exit
  35.  
  36. say gift.day
  37.