home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / textutil / jgpsuite / xmp / EXDIARY < prev    next >
Encoding:
Text File  |  1990-07-18  |  3.8 KB  |  162 lines

  1. .hd
  2. /
  3. /
  4. .ft 0
  5. /
  6. /
  7. .cpi 10 1 78
  8. .vbsw
  9. .setm 10
  10. *.if \s1+0 ge \u6  Last day of month
  11. .pushsect
  12. .setst :\s1=\u4:
  13. .setu 4 :\s1+1:
  14. .if \u4 gt 12
  15. .setu 4 :1:
  16. .setst :\s1=\u1:
  17. .setu 1 :\s1+1:   Next year
  18. .if \u1 eq 100
  19. .setu 1 :00:
  20. .setu 7 :20:
  21. .fi
  22. .fi
  23. .popsect
  24. .setst :\s1-\u6:
  25. .setst ::
  26. .fi
  27. * // Test for end of month and year
  28. .setm 12
  29. *\u11 \s1/\u4/\u1
  30. FoF
  31. \u10
  32. .fig 4
  33. .bar _
  34. * // Template to print for each day(u10), date(s1), month(u4), year(u1)
  35. .// ~ prompts and must end each input; # signifies that a number is wanted.
  36. .setu 1 :\u0~Year# (2digits)~:
  37. .setu 2 :\u0~Term?~:
  38. .setu 4 :\u0~Monday's Month#~:
  39. .setu 5 :\u0~Monday's date#~:
  40. .setu 7 :19:    Century
  41. .setu 9 :\u0~Week#~:
  42. .rpt  12
  43. *.setst |\s1=\u5|
  44. .setst :\s1-1:  Date specified by \s1 which increments
  45. .setst ::
  46. .setu 6  :99:   Last date
  47. .if \u5 gt 22   Near end of month
  48. .if \u4 eq 2    February
  49. .setu 6 :28:
  50. .if Y eq \u0~Y if leap year, otherwise anystring~
  51. .setu 6 :29:
  52. .fi
  53. .// .else            elseif not valid since orifs ff.
  54. .elseif \u4 eq 9     thirty days hath september,
  55. .orif \u4 eq 4   april,
  56. .orif \u4 eq 6   june and
  57. .orif \u4 eq 11  november
  58. .setu 6 :30:
  59. .else
  60. .setu 6 :31: all the rest have thirty one
  61. .// .fi
  62. .fi
  63. .fi
  64. .setst ::
  65. .fig 2
  66. .col
  67. \u2 Term \u7\u1| |Week \u9|
  68. .fig 1
  69. .bar _
  70. .ht 21 37 53 69
  71. .vbar ^| 13 29 45 61 77
  72. \t \cTo\ get\ done\ this\ week
  73. .fig 3
  74. \t \c\U}JOBS\V
  75. .bar _
  76. .vbsw +
  77. .nofj
  78.  \c}TIMED \c}UNTIMED \c}UNPLANNED \c\ EVE
  79. .setu 11 :Mon:
  80. \u12
  81. .setu 11 :Tue:
  82. \u12
  83. .setu 11 :Wed:
  84. \u12
  85. .setu 11 :Thu:
  86. \u12
  87. .setu 11 :Fri:
  88. \u12
  89. .vbsw
  90. \t \cTo\ get\ done\ this\ weekend
  91. .bar _
  92. .ht 6 26 46 62
  93. .vbar ^| 20 40 60 77
  94. .vbsw +
  95. \t}CONSTANT \t}INSTANT \t}DESIRABLE  \t}TIMINGS
  96. .sp 8
  97. .hln
  98. .nofj
  99. 1.Rest
  100. 2.Cherish J.
  101. 3.Plan Monday
  102. 4.Plan week
  103. 5.Shop
  104. 6.Cook
  105. 7.Clean
  106. 8.Tidy
  107. 9.Backup files
  108. 10.Plastic files
  109. 11.Wash
  110. 12.Wash hair
  111. 13.Report teaching
  112. 14.Prepare teaching
  113. .fig 2
  114. .vbsw
  115. .stop More weeks
  116. .pushsect
  117. .setst :\s1=\u9:
  118. .setu 9 :\s1+1:         Week +:= 1
  119. .popsect
  120. .setst :\s1+3:          Next mondays date
  121. \u10
  122. .setu 5 :\s1+0:         Maybe next month
  123. .vbsw
  124. .usel base
  125. *
  126. .stop Print discussion
  127. .page
  128. .vbsw
  129. .usel base
  130. .setst : ^|:
  131. .setend  :^| :
  132. This example is an outrageously extravagantly specialised use of user strings,
  133. and should not be taken as an example of how JGPrint should be used.
  134.  
  135. Nevertheless, it is a genuine example, in that my wife runs it each term. It
  136. also serves me as a severe test of the correct working of some of JGPrint's
  137. capabilities.
  138.  
  139. It has evolved over time, and has served as a spur to parts of JGPrint's
  140. design, notably the use of user variables as section number qualifiers and
  141. ..stop; it uses .rpt, .if, .setm, .pushsect and .popsect in interesting ways;
  142. as of July 89 I am contemplating the use of \\u<n>/\\s<n> as an argument to
  143. ..rpt, and the interpretation of \\u<n>/\\s<n> in .// and .stop directives. Any
  144. examples where these were of particular value would be gratefully received.
  145.  
  146. Essentially, section numbers and user variables are used as a universal (I
  147. think) machine that is a pig to program, to compute the dates needed for
  148. diary. Diary required a lot of testing and modifying before it did what I
  149. wanted, and anyone wanting to write a similar text is warned.
  150.  
  151. I did not multiply or divide for February, but the techniques needed are
  152. standard - and extremely long\-winded. I had no use for a while loop
  153. equivalent, but consider .if <trv>/.stop/.fi.....
  154.  
  155. It is interesting that, while writing these notes, I saw how to do a while,
  156. which needed a .stop without an enquiry to the user, which led me to modify
  157. the .stop code in a straightforward way.
  158.  
  159. I like the fact that there are no blank lines in the text; they can lead to
  160. muddles and are difficult to maintain correctly.
  161.  
  162. Finally, I repeat, this is not an example of the intended use of JGPrint.