Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0135/13/videdc.sim
There are 2 other files named videdc.sim in the archive. Click here to see a list.
00030 BEGIN COMMENT VIDED output in columns producer; OPTIONS(/l);
00060 EXTERNAL TEXT PROCEDURE rest, inline, scanto, conc, upcase, compress;
00090 EXTERNAL PROCEDURE filist, outchr;
00120 EXTERNAL CHARACTER PROCEDURE insinglechar;
00150 EXTERNAL INTEGER PROCEDURE scan, search, scanint;
00180
00210 TEXT ARRAY key, arg(1:6);
00240 INTEGER keydim, columns, endedpages, outline, cursorcolumn;
00270 INTEGER horizontalpos, bignum, breakchar;
00300 REF (column) firstcolumn, lastcolumn;
00330 REF (outfile) editout;
00360 CHARACTER linefeed, carriagereturn, escape, formfeed, tab, control_z;
00375 CHARACTER vt, sethmi, setvmi;
00390 BOOLEAN pageready, notabs, startformfeed, diablo;
00420
00450 PROCEDURE initialize; BEGIN
00480 outtext("%VIDEDC VERSION 1 IS HERE"); outimage;
00510 key(1):- copy("/O"); ! actually empty key;
00540 key(2):- copy("="); ! infile;
00570 key(3):- copy("/D"); ! /DIABLO;
00600 key(4):- copy("/TE"); ! /TERMINET;
00630 key(5):- copy("/C"); ! /COLUMNS:n;
00660 key(6):- copy("/TA"); ! /TABS, do not simulate tabs with spaces;
00690 keydim:= 6;
00720 cursorcolumn:= 1; bignum:= 999999999;
00750 linefeed:= char(10); carriagereturn:= char(13); control_z:= char(26);
00780 escape:= char(27); formfeed:= char(12); tab:= char(9);
00795 sethmi:= char(31); setvmi:= char(30); vt:= char(11);
00810 END;
00840
00870 PROCEDURE read_command; BEGIN
00900 TEXT coltxt;
00930 WHILE scan(inline("*",sysin),keydim,arg,key,1) NE 0 DO
00960 BEGIN
00990 outtext("? Multiple keywords."); outimage;
01020 END;
01035 diablo:= arg(3) =/= NOTEXT;
01050 coltxt:- arg(5); coltxt.setpos(1);
01080 scanto(coltxt,':'); coltxt:- rest(coltxt);
01110 WHILE coltxt.pos = 1 DO BEGIN
01140 columns:= scanint(coltxt);
01170 IF coltxt.pos = 1 THEN
01200 coltxt:- copy(inline("Input no of columns: ",sysin));
01230 END;
01260 END;
01290
01320 PROCEDURE create_columns; BEGIN
01350 INTEGER colno; REF (column) nextcol;
01380 nextcol:- lastcolumn:- NEW column(columns,NONE);
01410 FOR colno:= columns-1 STEP -1 UNTIL 1 DO nextcol:-
01440 NEW column(colno,nextcol);
01470 firstcolumn:- lastcolumn.nextcolumn:- nextcol;
01500 END;
01530
01560 PROCEDURE process_text; BEGIN
01590 editout:- NEW outfile(arg(1));
01620 IF editout == NONE THEN
01650 BEGIN outtext("Cannot open output file."); outimage; GOTO start;
01680 END;
01710 editout.open(NOTEXT);
01740 resume(firstcolumn);
01770 END;
01800
01830 PROCEDURE finalize; BEGIN
01860 firstcolumn.close; ! will close all columns recursively;
01890 editout.close;
01920 END;