home *** CD-ROM | disk | FTP | other *** search
- .hd
- /
- /
- .ft 0
- /
- /
- .cpi 10 1 78
- .vbsw
- .setm 10
- *.if \s1+0 ge \u6 Last day of month
- .pushsect
- .setst :\s1=\u4:
- .setu 4 :\s1+1:
- .if \u4 gt 12
- .setu 4 :1:
- .setst :\s1=\u1:
- .setu 1 :\s1+1: Next year
- .if \u1 eq 100
- .setu 1 :00:
- .setu 7 :20:
- .fi
- .fi
- .popsect
- .setst :\s1-\u6:
- .setst ::
- .fi
- * // Test for end of month and year
- .setm 12
- *\u11 \s1/\u4/\u1
- FoF
- \u10
- .fig 4
- .bar _
- * // Template to print for each day(u10), date(s1), month(u4), year(u1)
- .// ~ prompts and must end each input; # signifies that a number is wanted.
- .setu 1 :\u0~Year# (2digits)~:
- .setu 2 :\u0~Term?~:
- .setu 4 :\u0~Monday's Month#~:
- .setu 5 :\u0~Monday's date#~:
- .setu 7 :19: Century
- .setu 9 :\u0~Week#~:
- .rpt 12
- *.setst |\s1=\u5|
- .setst :\s1-1: Date specified by \s1 which increments
- .setst ::
- .setu 6 :99: Last date
- .if \u5 gt 22 Near end of month
- .if \u4 eq 2 February
- .setu 6 :28:
- .if Y eq \u0~Y if leap year, otherwise anystring~
- .setu 6 :29:
- .fi
- .// .else elseif not valid since orifs ff.
- .elseif \u4 eq 9 thirty days hath september,
- .orif \u4 eq 4 april,
- .orif \u4 eq 6 june and
- .orif \u4 eq 11 november
- .setu 6 :30:
- .else
- .setu 6 :31: all the rest have thirty one
- .// .fi
- .fi
- .fi
- .setst ::
- .fig 2
- .col
- \u2 Term \u7\u1| |Week \u9|
- .fig 1
- .bar _
- .ht 21 37 53 69
- .vbar ^| 13 29 45 61 77
- \t \cTo\ get\ done\ this\ week
- .fig 3
- \t \c\U}JOBS\V
- .bar _
- .vbsw +
- .nofj
- \c}TIMED \c}UNTIMED \c}UNPLANNED \c\ EVE
- .setu 11 :Mon:
- \u12
- .setu 11 :Tue:
- \u12
- .setu 11 :Wed:
- \u12
- .setu 11 :Thu:
- \u12
- .setu 11 :Fri:
- \u12
- .vbsw
- \t \cTo\ get\ done\ this\ weekend
- .bar _
- .ht 6 26 46 62
- .vbar ^| 20 40 60 77
- .vbsw +
- \t}CONSTANT \t}INSTANT \t}DESIRABLE \t}TIMINGS
- .sp 8
- .hln
- .nofj
- 1.Rest
- 2.Cherish J.
- 3.Plan Monday
- 4.Plan week
- 5.Shop
- 6.Cook
- 7.Clean
- 8.Tidy
- 9.Backup files
- 10.Plastic files
- 11.Wash
- 12.Wash hair
- 13.Report teaching
- 14.Prepare teaching
- .fig 2
- .vbsw
- .stop More weeks
- .pushsect
- .setst :\s1=\u9:
- .setu 9 :\s1+1: Week +:= 1
- .popsect
- .setst :\s1+3: Next mondays date
- \u10
- .setu 5 :\s1+0: Maybe next month
- .vbsw
- .usel base
- *
- .stop Print discussion
- .page
- .vbsw
- .usel base
- .setst : ^|:
- .setend :^| :
- This example is an outrageously extravagantly specialised use of user strings,
- and should not be taken as an example of how JGPrint should be used.
-
- Nevertheless, it is a genuine example, in that my wife runs it each term. It
- also serves me as a severe test of the correct working of some of JGPrint's
- capabilities.
-
- It has evolved over time, and has served as a spur to parts of JGPrint's
- design, notably the use of user variables as section number qualifiers and
- ..stop; it uses .rpt, .if, .setm, .pushsect and .popsect in interesting ways;
- as of July 89 I am contemplating the use of \\u<n>/\\s<n> as an argument to
- ..rpt, and the interpretation of \\u<n>/\\s<n> in .// and .stop directives. Any
- examples where these were of particular value would be gratefully received.
-
- Essentially, section numbers and user variables are used as a universal (I
- think) machine that is a pig to program, to compute the dates needed for
- diary. Diary required a lot of testing and modifying before it did what I
- wanted, and anyone wanting to write a similar text is warned.
-
- I did not multiply or divide for February, but the techniques needed are
- standard - and extremely long\-winded. I had no use for a while loop
- equivalent, but consider .if <trv>/.stop/.fi.....
-
- It is interesting that, while writing these notes, I saw how to do a while,
- which needed a .stop without an enquiry to the user, which led me to modify
- the .stop code in a straightforward way.
-
- I like the fact that there are no blank lines in the text; they can lead to
- muddles and are difficult to maintain correctly.
-
- Finally, I repeat, this is not an example of the intended use of JGPrint.