summaryrefslogtreecommitdiff
path: root/system/printer-9nadel/1986/src/CHARED.ELA
blob: a54679fc854f6eea7b64522754ee8f93070bf669 (plain)
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
PACKET chared DEFINES chared : 
 
PROC chared (TEXT VAR text denoter, BOOL CONST dens) :
FILE VAR f := editfile; 
TEXT VAR t ; 
ROW 30 INT VAR bytes ; 
INT VAR i, zeile, max breite := 0 ; 
FOR i FROM 1 UPTO 30 REP 
 bytes(i) := 0 
PER ; 
input (f) ; 
zeile := 7 ;
WHILE NOT eof (f) REP 
 getline (f, t) ; 
 convert line ; 
 zeile DECR 1
UNTIL zeile < 0 PER ; 
convert to text denoter . 
 
 
convert line : 
 FOR i FROM 1 UPTO LENGTH t REP 
  IF (t SUB i) <> " " AND (t SUB i) <> "." 
     THEN setbit (bytes (i), zeile) ; 
          max breite := max (max breite, i)
  FI 
 PER . 
 
convert to text denoter : 
 text denoter := """""27""K""" ;
 IF dens 
   THEN text denoter CAT text (max breite) 
   ELSE text denoter CAT text (max breite DIV 2) 
 FI ; 
 text denoter CAT """""0""" ; 
 FOR i FROM 1 UPTO max breite REP 
  IF dens OR (i AND 1) = 1 
     THEN text denoter CAT """" ; 
          text denoter CAT text (bytes (i)) ; 
          text denoter CAT """"
  FI
 PER ; 
 text denoter CAT """" . 
 
ENDPROC chared ; 
 
ENDPACKET chared