home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / dsy2kcal.zip / Calendar_2000 (.txt)
DeScribe Document  |  1997-04-02  |  20KB  |  159 lines

  1. DeScribe  Copyright DeScribe, Inc., 1988, 1989
  2. Letter
  3. <none>
  4. <none>
  5. HPLaserJ
  6. HPLaserJ
  7. LASERJET
  8. HP LaserJet 5/5M
  9. HP LaserJet 5/5M
  10. Letter
  11. Black
  12. White
  13. Letter
  14. 00 READY
  15. Custom Watermark
  16. Info 1
  17. Info 2
  18. Info 3
  19. Info 4
  20. Macro
  21. Courier
  22. Courier New
  23. !   This macro prompts the user for a month and a year,
  24. !   calls up the Calendar Layout and fills in the headings
  25. !   with appropriate values.
  26. VAR month
  27. VAR day
  28. VAR year
  29. VAR yearstring
  30. VAR noDays
  31. VAR daySeq
  32. VAR mo
  33. VAR count
  34. PROCEDURE DaysInMonth
  35. !   arguments are m and y, returns d
  36.     SET d TO 31           
  37.     IF m=1 THEN SET mo TO "JANUARY" RETURN END IF
  38.     IF m=3 THEN SET mo TO "MARCH" RETURN END IF
  39.     IF m=5 THEN SET mo TO "MAY" RETURN END IF
  40.     IF m=7 THEN SET mo TO "JULY" RETURN END IF
  41.     IF m=8 THEN SET mo TO "AUGUST" RETURN END IF
  42.     IF m=10 THEN SET mo TO "OCTOBER" RETURN END IF
  43.     IF m=12 THEN SET mo TO "DECEMBER" RETURN END IF
  44.     SET d TO 30
  45.     IF m=4 THEN SET mo TO "APRIL" RETURN END IF
  46.     IF m=6 THEN SET mo TO "JUNE" RETURN END IF
  47.     IF m=9 THEN SET mo TO "SEPTEMBER" RETURN END IF
  48.     IF m=11 THEN SET mo TO "NOVEMBER" RETURN END IF
  49.     SET mo TO "FEBRUARY"
  50.     SET z TO year MOD 4
  51.     IF z = 0 THEN
  52.         SET d to 29
  53.     ELSE
  54.         SET d TO 28
  55.     END IF
  56. END PROCEDURE
  57. PROCEDURE CheckMon
  58. !   Call with:  month=month
  59. !               year=year
  60. !   Exits with: noDays=no. of days in month
  61. !               monthName=text of month name
  62. !               daySeq=first day (0=Sun, 1=Mon, ..., 6=Sat)
  63.     SET count TO year * 365
  64.     SET q TO year - 1
  65.     SET q TO q / 4
  66.     SET count TO count + q
  67.     SET m TO 1
  68.     SET y TO year
  69.     REPEAT
  70.         EXIT WHEN m = month
  71.         CALL DaysInMonth
  72.         SET count TO count + d
  73.         SET m TO m + 1
  74.     END REPEAT
  75.     SET x TO count+1
  76.     SET z TO x MOD 7
  77.     SET daySeq TO z
  78.     SET m TO month
  79.     CALL DaysInMonth
  80.     SET noDays TO d
  81. END PROCEDURE
  82. MACRO Calendar
  83.     SET MacroDialogTitle to 
  84. Set up Calendar
  85.     MSET "Month (1-12)" TOVALUE month
  86.     MSET "Year (94, for example)" TOVALUE year
  87.     MGET 
  88. To create a Calendar table in a new DeScribe document, type the desired month and year.
  89.     IF month < 1 THEN QUIT END IF
  90.     IF month > 12 THEN QUIT END IF
  91.     !year should be 0 through 99
  92.     IF year < 0 THEN QUIT END IF
  93.     IF year > 99 THEN QUIT END IF
  94.     !all years less than 90 will be 2000+
  95.     IF year < 90 THEN SET year TO year + 100 END IF
  96.     !must use string constant since we
  97. re crossing millenia boundaries,
  98.     ! i.e. simple constant plus addition won
  99. t work here.
  100.     CONVERT year + 1900 TOSTRING yearstring
  101.     CALL CheckMon 
  102.     NewDocumentFile "CALENDAR"
  103.     SET SelectedFrame TO 
  104.     CursorHome
  105.     PUT mo
  106.     PUT " "
  107.     KeyTab
  108.     PUT yearstring
  109.     CursorEndLine
  110.     CursorEndLine
  111.     CursorEndLine
  112.     CursorEndLine
  113.     CursorEndLine
  114.     CursorEndLine
  115.     CursorEndLine
  116.     TableCellRight
  117.     REPEAT
  118.         EXIT WHEN daySeq = 0
  119.         TableCellRight
  120.         SET daySeq TO daySeq - 1
  121.     END REPEAT
  122.     SET d TO 1
  123.     REPEAT
  124.         PUT d
  125.         EXIT WHEN d = noDays
  126.         SET d TO d + 1
  127.         TableCellRight
  128.     END REPEAT
  129.     TableModifyStart
  130.     SET TableTabCreateRows TO FALSE
  131.     TableProcessChanges
  132.     CursorHome
  133.     SET SelectedFrame TO 
  134. DeNote
  135. END MACRO
  136. DeScribe Glossary
  137. Create date
  138. Create time
  139. Document name
  140. File name
  141. Pages
  142. Pages (Alphabetic lower case)
  143. Pages (Alphabetic upper case)
  144. Pages (Roman lower case)
  145. Pages (Roman upper case)
  146. Print date
  147. Print time
  148. Revisions
  149. Save date
  150. Save time
  151. August 4, 1994
  152. 12:31 P.M.
  153. Calendar_2000
  154. E:\DeScribe\Macros\Calendar_2000
  155. April 2, 1997
  156. 3:23 P.M.
  157. April 2, 1997
  158. 3:26 P.M.
  159.