{$T-} program TWOCOL; {15 Jul 1978 RSX-11 usage: MCR>TCL - infile.lst outfile.lst } const NL=chr(10); {new line} FF=chr(12); {form feed} HT=chr(9); {horizontal tab} const LASTLINE=51; LASTCHAR=59; var C,I,L1,L2: integer; CH:char; FIRSTCOL: array[0..LASTLINE] of record LINE: array [0..LASTCHAR] of char end; infile, listing: text; begin reset(infile, argv[2]@); rewrite(listing, argv[3]@, 2); while not eof(infile) do begin L1:=0; repeat C:=0; { with FIRSTCOL[L1] do} begin repeat read(infile,CH); if CH>=' ' then begin FIRSTCOL[L1].LINE[C]:=CH; C:=C+1 end else if CH=HT then repeat FIRSTCOL[L1].LINE[C]:=' '; C:=C+1 until (C mod 8)=0 until (CH=NL) or (C>LASTCHAR) or eof(infile); for I:=C to LASTCHAR do FIRSTCOL[L1].LINE[I]:=' ' end; L1:=L1+1 until (L1>LASTLINE) or (CH=FF) or eof(infile); L2:=0; while L2FF) and not eof(infile) then begin write(listing,' '); C:=0; repeat read(infile,CH); if CH>=' ' then begin write(listing,CH); C:=C+1 end else if CH=HT then repeat write(listing,' '); C:=C+1 until (C mod 8)=0 until (CH=NL) or (C>LASTCHAR) or (CH=FF) or eof(infile) end; write(listing,NL); L2:=L2+1 end; write(listing,FF) end; write(output,NL,'end TWOCOL',NL); break(output) end.