1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 get "runoff_head"
19
20
21
22
23
24
25
26 let Control () be
27 {
28
29
30
31
32 Nrx := 4
33 Nr := Nr + 1
34 while Rawchar[Nrx] ne '*s' & Nrx < Nr do Nrx := Nrx + 1
35 while Rawchar[Nrx] = '*s' & Nrx < Nr do Nrx := Nrx + 1
36
37
38
39 switchon (Rawchar[2]lshift ByteBits logor Rawchar[3]) into
40 {
41 default: if Rawchar[2] = '**' return
42 Report ("Unknown control request")
43 return
44
45 case '** ':
46 return
47
48 case '~ ':
49 if Charsw do
50 $( for i = 1 to Nr - 1 do WrCh (Rawchar!i)
51 WrCh ('*n')
52 $)
53 return
54
55 case 'ad':
56 Break (); Ad := true; return
57
58 case 'ar':
59 Roman := false; return
60
61 case 'bp':
62 Break (); Eject (); return
63
64 case 'br':
65 Break (); return
66
67 case 'cc':
68 test Nrx = Nr
69 then Spec_char := '%'
70 else Spec_char := Rawchar[Nrx]
71 return
72
73 case 'ce':
74 Break (); Ce := Number (); Need (Ce); return
75
76 case 'ch':
77 while Nrx < Nr do
78 $( CharsTable!(Rawchar!Nrx) := Rawchar!(Nrx + 1)
79 Nrx := Nrx + 2
80 $)
81 return
82
83 case 'ds':
84 Break (); Ms := 2; Need (2); return
85
86 case 'ef':
87 Sethead (Ef); SetLinesLeft (); return
88
89 case 'eh':
90 Sethead (Eh); return
91
92 case 'eq':
93
94 Break (); Eq := Number (); Need (Eq); return
95
96 case 'ex':
97 if Nrx < Nr do ExecuteCommand ()
98 return
99
100 case 'fh':
101 unless Fth = 0 do Freevec (Fth)
102 Fth := Gethead ()
103 return
104
105 case 'fi':
106 Break (); unless NoFill do Fi := true; return
107
108 case 'fo':
109 Sethead (Ef); Sethead (Of); SetLinesLeft (); return
110
111 case 'fr':
112 if Rawchar[Nrx] = 'f' do { Fr := false; return }
113 if Rawchar[Nrx] = 't' do { Fr := true; return }
114 if Rawchar[Nrx] = 'u' do { NoFtNo := true; return }
115 Fr := false
116 return
117
118 case 'ft':
119 test Ft
120 then Foot_end ()
121 or Foot_begin ()
122 return
123
124 case 'gb':
125 Skiptolabel (false)
126 return
127
128 case 'gf':
129 Skiptolabel (true)
130 return
131
132 case 'he':
133 Sethead (Eh); Sethead (Oh); return
134
135 case 'if':
136 InsertFile (); return
137
138 case 'in':
139
140 Break ()
141 Set_param (lv In, 0)
142 Un := In
143 return
144
145 case 'la':
146 return
147
148 case 'li':
149
150 LIno := Number (); return
151
152 case 'll':
153
154 Set_param (lv Ll, LL_); return
155
156 case 'ma':
157
158 Set_param (lv Ma1, MA1_); Set_param (lv Ma4, MA4_)
159 SetLinesLeft ()
160 return
161
162 case 'm1':
163
164 Set_param (lv Ma1, MA1_)
165 return
166
167 case 'm2':
168
169 Set_param (lv Ma2,MA2_)
170 return
171
172 case 'm3':
173
174 Set_param (lv Ma3,MA3_)
175 SetLinesLeft ()
176 return
177
178 case 'm4':
179
180 Set_param (lv Ma4,MA4_)
181 SetLinesLeft ()
182 return
183
184 case 'mp':
185
186 Set_param (lv MultiplePagecount, 1)
187 return
188
189 case 'ms':
190
191 Break ()
192 Set_param (lv Ms, 1)
193 Need (2)
194 return
195
196 case 'na':
197 Break (); Ad := false; return
198
199 case 'ne':
200 NeedSS (Number ()); return
201
202 case 'nf':
203 Break (); Fi := false; return
204
205 case 'of':
206 Sethead (Of); SetLinesLeft (); return
207
208 case 'oh':
209 Sethead (Oh); return
210
211 case 'op':
212 Break (); Eject (); Np := Np + 1 - Np rem 2; goto SetPrint
213
214 case 'pa':
215
216 Break (); Eject ()
217 Set_param (lv Np, Np)
218 SetPrint:
219 NNp := Np + 1
220 Print := Fp le Np le Lp & Passes le 1
221 return
222
223 case 'pi':
224
225 Pi := Pi + Number ()
226 if Pi le LinesLeft do
227 $( Newline (Pi)
228 Pi := 0
229 $)
230 return
231
232 case 'pl':
233
234 unless NoPaging do Set_param (lv Pl, PL_)
235 SetLinesLeft ()
236 return
237
238
239 case 'rd':
240 Nr := ConsoleReadline (Rawchar)
241 Again := true
242 return
243
244 case 'ro':
245 Roman := true; return
246
247 case 'rt':
248 Nr := 0; Nx_close (); return
249
250 case 'sk':
251 NNp := NNp + Number (); return
252
253 case 'sp':
254
255 Break ()
256 if Nl = 0 do Spacing ()
257 Newline (MinI (Number (), LinesLeft))
258 Need (2)
259 return
260
261 case 'sr':
262 Set_ref ()
263 return
264
265 case 'ss':
266 Break (); Ms := 1; Need (2); return
267
268 case 'tr':
269
270 while Nrx < Nr do
271 $( TrTable!(Rawchar!Nrx) := Rawchar!(Nrx + 1)
272 Conv!(Rawchar!Nrx) := DeviceTable!(Rawchar!(Nrx + 1))
273 Nrx := Nrx + 2
274 $)
275 return
276
277 case 'ts':
278 if Number () = 0 do Readline (); return
279
280 case 'ty':
281 Typeout (); return
282
283 case 'un':
284
285 Break ()
286 Un := Nrx ge Nr -> 0, In - Number ()
287 if Un < 0 do Un := 0
288 return
289
290 case 'ur':
291 if Nrx < Nr do
292 $( let w = vec Maxline
293 Nr := Use_ref (Rawchar + Nrx - 1, w, Nr - Nrx)
294 for i = 1 to Nr do Rawchar!i := w!i
295 Rawchar!(Nr + 1) := '*s'
296 Again := true
297 $)
298 return
299
300 case 'wt':
301 Wait (); return
302
303 }
304 }
305
306
307
308
309
310
311
312
313
314 and Set_param (Param, Default) be
315 $( Check_ref ()
316 if Nrx ge Nr do
317 $( rv Param := Default
318 return
319 $)
320 let OldNrx = Nrx
321 let P = ReadParam (rv Param)
322 if P < 0 do P := 0
323 rv Param := P
324 Nrx := OldNrx
325 $)
326 and Number () = valof
327 $( if Nrx ge Nr resultis 1
328 Check_ref ()
329 ExpError := false
330 let v = vec Maxline
331 let n = ReadExp (0, v)
332 if ExpError | Nrx < Nr do Report ("Malformed expression")
333 resultis n
334 $)