1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
PACKET minimal font routines DEFINES lf height of current font,
x factor per inch,
y factor per inch:
REAL CONST lf height of current font :: 2.54 / 6.0;
INT CONST x factor per inch :: 10,
y factor per inch :: 6;
END PACKET minimal font routines;
PACKET minimal printer (* 25.04.84 *)
DEFINES material,
start,
new page,
reset printer,
line,
print text ,
printer cmd,
on,
off,
x pos,
y pos,
papersize,
limit,
change type:
PROC change type (TEXT CONST name of type): ENDPROC change type;
PROC material (TEXT CONST value): END PROC material;
PROC start (REAL CONST x,y): END PROC start;
PROC papersize (REAL CONST x,y): END PROC papersize;
PROC limit (REAL CONST l): END PROC limit;
PROC on (TEXT CONST cmd): END PROC on;
PROC off (TEXT CONST cmd): END PROC off;
PROC xpos (REAL CONST cm): END PROC xpos;
PROC ypos (REAL CONST cm): END PROC ypos;
PROC printer cmd (TEXT CONST cmd):
out (buffer); buffer := "";
out(cmd)
END PROC printer cmd;
INT VAR actual line ;
TEXT VAR buffer;
PROC reset printer:
buffer := "";
actual line := 0
ENDPROC reset printer;
PROC print text (TEXT CONST content, INT CONST mode):
buffer CAT content
ENDPROC print text;
PROC new page:
IF buffer <> ""
THEN line (1.0)
FI;
actual line := actual line MOD 72 ;
IF actual line > 0
THEN page feed
FI .
page feed :
INT VAR i ;
FOR i FROM actual line UPTO 71 REP
out(" "13""10"")
PER ;
actual line := 0
ENDPROC new page;
PROC line (REAL CONST lf):
out (buffer); buffer := "";
IF lf > 0.0
THEN REAL VAR ist := 0.0 ;
REP
out (""13""10"") ;
actual line INCR 1 ;
ist INCR 1.0
UNTIL ist >= floor (lf) PER
FI
ENDPROC line;
ENDPACKET minimal printer;
|