1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 get "runoff_head"
21
22
23 global
24 { LineC : 330
25 LineP : 331
26 FF : 332
27 LPW : 333
28 Buff : 334
29 Red : 335
30 }
31
32 let WrChInit () be
33 { Buff := Newvec (Maxline)
34 LPW := -1
35 LineC := 1
36 LineP := 0
37 FF := false
38 Red := false
39
40 for i = 0 to 127 do CharsTable!i := '*s'
41 let T1 = table '[', ']', '{', '}', '~', '`'
42 and T2 = table '<', '>', '(', ')', 't', '*''
43 for i = 0 to 5 do CharsTable!(T1!i) := T2!i
44 }
45 and WrCh (c) be // Write out character c.
46 $( test CharsTable!c = '*s'
47 then $( if Red do
48 $( Store ('*k')
49 Red := false
50 $)
51 Store (c)
52 $)
53 or $( unless Red do
54 $( Store ('*d')
55 Red := true
56 $)
57 Store (CharsTable!c)
58 FF := true
59 $)
60 if c = '*n' do
61 $( if FF do Wrline ()
62 LineP, FF, Red := 0, false, false
63 $)
64 $)
65 and Wrline () be
66 $( if Red do Store ('*k')
67 if LPW ne Np do // First line printed on this page.
68 $( WriteS (ChStream, "*n*n*nPage ")
69 WriteN (ChStream, Np)
70 WriteS (ChStream, "*n*n*n")
71 LPW := Np
72 $)
73 if Nl < 10 do Writech (ChStream, '*s')
74 WriteN (ChStream, Nl)
75 Writech (ChStream, '*t')
76 for i = 1 to LineP do Writech (ChStream, Buff[i])
77 $)
78 and Store (c) be
79 $( LineP := LineP + 1
80 Buff[LineP] := c
81 $)