Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-04 - decus/20-0135/comp/mided3.lst
There are no other files named mided3.lst in the archive.
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		00030	OPTIONS(/l/e); COMMENT VIDED - DISPLAY EDITOR. See

SIM013  W LINE    30     EXTERNAL SWITCH ALREADY SPECIFIED, IGNORED 

		00060	VISTA.MAN for explanations on the routines used in this program;
		00090	COMMENT Copyright (c) Swedish National Defense Research Institute;
		00120	COMMENT The Author and the Swedish National Defense Research
		00150	Institute take no responsibility for errors in this program or other
		00180	files connected with it;
		00210	
		00240	COMMENT COMMENT%IF VIDTIM marks additions to output everything
		00270	input from the user terminal onto a log file;
		00300	COMMENT COMMENT%IF STAT marks output of statistics on command
		00330	usage;
		00360	COMMENT COMMENT%IF FQC marks additions to enable the use of
		00390	FQC for frequency counting on VIDED;
		00420	COMMENT COMMENT%IF DEBUGTERMINAL marks additions to allow separate
		00450	debug and editing terminals;
		00480	COMMENT COMMENT%IF DEBUGSLOW marks additions to create artificial
		00510	slowness to debug behaviour on a heavily loaded machine;
		00540	
		00570	COMMENT all the external procedures below are described in the
		00600	DECsystem-10 SIMULA Language Handbook part 3;
		00630	COMMENT%IF callmac;
		00660	EXTERNAL PROCEDURE vtmcur, vtsynk, vtisng;
		00690	COMMENT%IFEND CALLMAC;
		00720	EXTERNAL PROCEDURE outche, tshift, pgcopy, vdccin, vdccout;
		00750	EXTERNAL INTEGER PROCEDURE iondx, vdlno;
		00780	EXTERNAL TEXT PROCEDURE tmpin, conc, front, storbokstav,
		00810	litenbokstav, rest, filspc, inline, frontstrip, scanto, from, upto,
		00840	today, tmpnam, compress, skip, maketext;
		00870	
		00900	EXTERNAL CHARACTER PROCEDURE findtrigger, fetchar;
		00930	EXTERNAL INTEGER PROCEDURE search, scanint, rename;
		00960	EXTERNAL INTEGER PROCEDURE sscan;
		00990	EXTERNAL REF (infile) PROCEDURE findinfile;
		01020	EXTERNAL REF (outfile) PROCEDURE findoutfile;
		01050	EXTERNAL CHARACTER PROCEDURE getch;
		01080	EXTERNAL INTEGER PROCEDURE trmop, gettab, checkint;
		01110	EXTERNAL BOOLEAN PROCEDURE puttext, numbered, tmpout, rescan,
		01140	dotypeout, bokstav;
		01170	EXTERNAL PROCEDURE depchar, outstring, forceout, echo, abort, exit,
		01200	outchr, run;
		01230	COMMENT%IF debugslow
		01260	EXTERNAL PROCEDURE sleep;
		01290	COMMENT%IFEND debugslow;
		01320	EXTERNAL BOOLEAN PROCEDURE meny;
		01350	EXTERNAL CLASS termty;
		01380	COMMENT%IF CALLMAC;
		01410	EXTERNAL CLASS mmista, mided1, mided2;
		01440	mided2 CLASS mided3;

SIM052  W LINE  1440     ILLEGAL SWITCH SETTING 

DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   1-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		01470	COMMENT%IFNOT CALLMAC
		01500	EXTERNAL CLASS mvista, vided1, vided2;
		01530	COMMENT%IFNOT CALLMAC
		01560	vided2 CLASS vided3;
		01590	COMMENT%IFEND CALLMAC;
		 1591
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    2
DSK:MIDED3.SIM	   7-APR-1979   8:36	

B1		01620	BEGIN
		01650	COMMENT%IF debugterminal - when debugging with a separate debug
		01680	REF (infile) newsysin;   ! terminal for SIMDDT i/o and another;
		01710	COMMENT%IF debugterminal   terminal for the VIDED editing
		01740	REF(outfile) newsysout;
		01770	COMMENT%IFEND debugterminal;
		01800	COMMENT%IF VIDTIM
		01830	REF (outfile) vidtim; ! File for log of input from terminal;
		01860	COMMENT%IFEND VIDTIM;
		01890	COMMENT%IF STAT
		01920	REF (outfile) stat; ! File for statistics;
		01950	COMMENT%IFEND STAT;
		01980	
		02010	REF (vided3x) the_editor;
		02040	INTEGER giventrmspeed; ! terminal speed given by user;
		02070	INTEGER terminaltype; ! Number of user terminal type;
		02100	INTEGER height; ! Number of lines on the screen;
		02130	INTEGER width; ! Number of characters in a line on the screen;
		02160	INTEGER bad_line_count; ! Count of bad lines;
		02190	INTEGER oldnarg; ! Number of lines to be shown after &N search;
		02220	INTEGER backupzscroll; ! Line to scroll to after file backup;
		02250	INTEGER backupsubpage; ! backup to this sub_page_number;
		02280	INTEGER backuphor; ! Horzontal pos to return to after backup;
		02310	INTEGER backupvert; ! Vertical pos to return to after backup;
		02340	INTEGER backupchecksum; ! to check that backup came back right;
		02370	INTEGER autobackcount; ! count for automatic &FB generation;
		02400	INTEGER autobackup; ! limit for above count;
		02430	COMMENT%IF debugterminal
		02460	BOOLEAN debug; ! Debugging with separate terminal for SIMDDT;
		02490	COMMENT%IFEND debugterminal;
		02520	CHARACTER volkeomchar; ! Volker 414h EOM character;
		02550	BOOLEAN merryentry; ! entered through merrygoround;
		02580	BOOLEAN pagebottom; ! E argument to &P command;
		02610	BOOLEAN synka; ! Synchronization needed of cursor;
		02640	BOOLEAN tempfilecommand; ! VIDED got its command string from
		02670	the tmpfile "VID";
		02700	TEXT infilename;
		02730	TEXT outfilename;
		02760	TEXT inprotect; ! Protection code on input file;
		02790	TEXT indevice; ! Device of input file;
		02820	TEXT inspec; ! Input file specification;
		02850	TEXT tempfilename; ! Temporary file name;
		02880	TEXT please; ! Temporary text;
		02910	BOOLEAN otherppn; ! Input file from other PPN than your own;
		02940	CHARACTER c; ! for local use;
		 2941
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    3
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		02970	PROCEDURE zeroini(i);
		03000	COMMENT zero /N from SWITCH.INI if /-N in command string etcetera;
		03030	INTEGER i;
		03060	IF arg[i] =/= NOTEXT OR arg[i+1] =/= NOTEXT
		03090	THEN ini[i]:- ini[i+1]:- NOTEXT;
		03120	
		03150	PROCEDURE overwritewarning(t); TEXT t;
		03180	IF NOT tempfilecommand THEN
B2		03210	BEGIN
		03240	  outtext("%VIDED - You are overwriting a file: ");
		03270	  outtext(tempfilename);
		03300	  outtext(". To continue push RETURN."); outimage; inimage;
		03330	  INSPECT the_editor DO IF backuping THEN badscreen:= TRUE;
E2		03360	END;
		 3361
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    4
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		03390	BOOLEAN PROCEDURE helptype(heightm1,helpprint);
		03420	INTEGER heightm1; BOOLEAN helpprint;
		03450	COMMENT Action of &H VIDED command requesting the printing of a help
		03480	text;
B3		03510	BEGIN REF (infile) helpfile;
		03540	  INTEGER count; BOOLEAN limitfound; TEXT helpborder, sysoutimage;
		03570	  helpborder:- copy("VIDED EDITING COMMANDS"); arg[5]:- NOTEXT;
		03600	  sysoutimage:- sysout.image; sysout.image:- blanks(80);
		03630	  helpfile:- findinfile("HLP:VIDED.HLP");
		03660	  INSPECT helpfile DO
B4		03690	  BEGIN
		03720	    open(sysout.image); inimage;
		03750	    WHILE NOT helpfile.endfile DO
B5		03780	    BEGIN
		03810	      COMMENT Different part of help file printed depending
		03840	      on when this procedure is called;
		03870	      IF NOT limitfound THEN
B6		03900	      BEGIN
		03930	        limitfound:= search(image,helpborder) <= 60;
		03960	        IF limitfound THEN helpprint:= NOT helpprint;
E6		03990	      END;
		04020	      IF helpprint THEN
B7		04050	      BEGIN
		04080	        sysout.outimage;
		04110	        count:= count+1;
		04140	        IF count = heightm1 THEN
B8		04170	        BEGIN sysout.outtext("To continue push RETURN.");
		04200	          sysout.breakoutimage;
		04230	          sysin.inimage; count:= 0;
		04260	          outchr(sysout,char(13),1); !carriage return;
		04290	          outchr(sysout,' ',25); outchr(sysout,char(13),1);
E8		04320	        END;
E7		04350	      END;
		04380	      inimage;
E5		04410	    END;
		04440	    helptype:= TRUE;
		04470	    close;
E4		04500	  END;
		04530	  sysout.image:- sysoutimage;
E3		04560	END of procedure helptype;
		 4561
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    5
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		04590	PROCEDURE before_editing;
B9		04620	BEGIN
		04650	  topstart: !z_t(18); COMMENT Start of execution here;
		04680	  COMMENT%IF VIDTIM
		04710	  vidtim:- new outfile("VIDTIM *");
		04740	  COMMENT%IF VIDTIM
		04770	  vidtim.open(notext);
		04800	  COMMENT%IFEND VIDTIM;
		04830	  COMMENT%IF STAT
		04860	  IF stat == NONE THEN BEGIN
		04890	    stat:- new outfile("STAT.VID/ACCESS:APPEND");
		04920	  COMMENT%IF STAT
		04950	  stat.open(blanks(80)) END;
		04980	  COMMENT%IFEND STAT;
		05010	
		05040	  merryentry:= merrygoround;
		05070	  IF NOT merrygoround THEN
B10		05100	  BEGIN
		05130	    outtext("%VIDED DISPLAY TERMINAL EDITOR VERSION 4A IS HERE");
		05280	    outimage;
E10		05310	  END;
		05340	
		05370	  IF the_editor == NONE THEN
B11		05400	  BEGIN
		05430	    key[1]:-copy("/DEFAULT:"); ! output file name;
		05460	    key[2]:-copy("/T:"); ! terminal type;
		05490	    key[3]:-copy("="); ! input file name;
		05520	    key[4]:- copy("/DEBUG");
		05550	    key[5]:- copy("/H");
		05580	    key[6]:- copy("/N");
		05610	    key[7]:- copy("/-N");
		05640	    key[8]:- copy("/MP:");
		05670	    key[9]:- copy("/ML:");
		05700	    key[10]:- copy("/MR:");
		05730	    key[11]:- copy("/P");
		05760	    key[12]:- copy("/-P");
		05790	    key[13]:- copy("/L:");
		05820	    key[14]:- copy("/C:");
		05850	    key[15]:- copy("/JE");
		05880	    key[16]:- copy("/-JE");
		05910	    key[17]:- copy("/S:");
		05940	    key[18]:- copy("/DCA");
		05970	    key[19]:- copy("/-DCA");
		06000	    key[20]:- copy("/ALF");
		06030	    key[21]:- copy("/-ALF");
		06060	    key[22]:- copy("/OPTION:");
		06090	    key[23]:- copy("/SWEDISH");
		06120	    key[24]:- copy("/RUN:");
		06150	    key[25]:- copy("/COUNT:");
		06180	    key[26]:- copy("/AUTOBACKUP");
		06210	    key[27]:- copy("/SPEED:");
		06240	    keys:= 27;
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   5-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		06270	
E11		06300	  END of the_editor == NONE;
		 6301
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    6
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		06330	  start:
		06360	  IF the_editor == NONE THEN please:- tmpin("VID",TRUE)
		06390	  ELSE please:- NOTEXT;
		06420	  IF please =/= NOTEXT THEN
B12		06450	  BEGIN tempfilecommand:= TRUE;
		06480	    GOTO implicit_command;
E12		06510	  END ELSE IF NOT merrygoround THEN
B13		06540	  BEGIN
		06570	    IF rescan THEN
B14		06600	    BEGIN COMMENT Reread line invoking VIDED;
		06630	      sysin.inimage; please:- sysin.image;
		06660	      IF scanto(please,'-').length < please.length THEN
B15		06690	      BEGIN
		06720	        please:- rest(please);
		06750	        implicit_command:
		06780	        IF sscan(please,keys,arg,key,1) NE 0 THEN
		06810	        GOTO multiple ELSE GOTO gotparameters;
E15		06840	      END;
E13		06870	  END; END;
		06900	
		06930	  IF NOT merrygoround THEN
B16		06960	  BEGIN COMMENT Scan and interpret switches in input command;
		06990	    echo(sysin,0);
		07020	    WHILE sscan(inline("*",sysin),keys,arg,key,1) NE 0 DO
B17		07050	    BEGIN
		07080	      multiple: outtext("? Multiple keywords:");
		07110	      outtext(sysin.image.strip);
		07140	      outtext("please try again.");
		07170	      outimage;
E16		07200	  END; END;
		 7201
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    7
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		07230	  gotparameters:
		07260	
		07290	  COMMENT If the user gave no input file name, look for previously
		07320	  used file name in TMP:EDS;
		07350	  IF arg[1] = " " THEN
B18		07380	  BEGIN
		07410	    please:- tmpin("EDS",FALSE);
		07440	    please:- scanto(please,char(13)).strip;
		07470	    please:- scanto(please,char(10)).strip;
		07500	    scanto(please,' '); arg[1]:- rest(please);
E18		07530	  END;
		07560	  please:- NOTEXT;
		07590	
		07620	  IF NOT merrygoround THEN
B19		07650	  BEGIN
		07680	    INSPECT findinfile("SWITCH.INI") DO
B20		07710	    BEGIN COMMENT The SWITCH.INI file may contain personal default
		07740	      settings, e.g. telling VIDED what kind of terminal you are
		07770	      using;
		07800	      TEXT lineoption, switchoption, imagp;
		07830	      open(blanks(130));
		07860	      switchoption:- arg[22]; IF switchoption == NOTEXT THEN
		07890	      switchoption:- arg[1]; storbokstav(switchoption);
		07920	      inimage;
		07950	      imagp:- IF numbered THEN image.sub(7,124) ELSE image;
		07980	      WHILE NOT endfile DO
B21		08010	      BEGIN
		08040	        storbokstav(imagp);
		08070	        IF imagp.sub(1,5) = "VIDED" THEN
B22		08100	        BEGIN
		08130	          imagp.setpos(6); IF imagp.getchar = ':' THEN
B23		08160	          BEGIN lineoption:- scanto(imagp,' ');
		08190	            switchoption.setpos(1);
		08220	            IF search(switchoption,lineoption) > switchoption.length
		08250	            THEN GOTO afterread;
E23		08280	          END;
		08310	          IF sscan(rest(imagp),keys,ini,key,1) NE 0 THEN
B24		08340	          BEGIN outtext("? Multiple keywords"
		08370	            " in SWITCH.INI:");
		08400	            outtext(imagp.strip);
		08430	            outimage;
E24		08460	          END;
E22		08490	        END;
		08520	        afterread:
		08550	        inimage;
E21		08580	      END;
		08610	      close;
E20		08640	    END;
		08670	    COMMENT read Terminal information from TMP:TRM TMPCOR file;
		08700	    please:- tmpin("TRM",FALSE);
		08730	    IF please =/= NOTEXT THEN
		08760	    sscan(conc("/t:",please),keys,ini,key,1);
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   7-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

E19		08790	  END;
		 8791
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    8
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		08820	  IF NOT merrygoround AND (arg[1] = "?" OR arg[5] =/= NOTEXT) THEN
B25		08850	  BEGIN COMMENT type help text to the user;
		08880	    echo(sysin,2); ! no echo;
		08910	    IF NOT helptype(15,TRUE) THEN
B26		08940	    BEGIN outtext("Cannot find VIDED.HLP"); outimage;
E26		08970	    END;
		09000	    echo(sysin,4); ! echo again;
		09030	    GOTO start;
E25		09060	  END;
		09090	
		09120	  IF NOT merrygoround THEN
B27		09150	  BEGIN INTEGER i;
		09180	    COMMENT Use default settings from the SWITCH.INI file;
		09210	    IF arg[2] =/= NOTEXT THEN ini[18]:- ini[19]:- NOTEXT;
		09240	    zeroini(6); zeroini(11); zeroini(15);
		09270	    zeroini(18); zeroini(20);
		09300	    FOR i:= 1 STEP 1 UNTIL keys DO
B28		09330	    BEGIN IF arg[i] == NOTEXT THEN arg[i]:- ini[i];
E28		09360	    END;
E27		09390	  END;
		09420	
		09450	  editin:- findinfile(arg[1]);
		09480	  IF editin =/= NONE THEN
B29		09510	  BEGIN
		09540	    IF arg[3] =/= NOTEXT THEN
		09570	    overwritewarning(arg[1]) ELSE
B30		09600	    BEGIN
		09630	      arg[3]:- arg[1];
		09660	      tmpoutfile:= TRUE;
E30		09690	    END;
E29		09720	  END ELSE IF arg[3] == NOTEXT THEN arg[3]:- copy("NUL:NUL");
		09750	  IF arg[1] NE arg[3] THEN editin:- findinfile(arg[3]);
		09780	  IF editin == NONE THEN
B31		09810	  BEGIN outtext("?CANNOT FIND INPUT FILE: "); outtext(arg[3]);
		09840	    outimage; GOTO start;
E31		09870	  END;
		09900	
		09930	  editin.open(blanks(IF width < 140 THEN 140 ELSE width));
		 9931
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE    9
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		09960	  COMMENT find and interpret input file specification;
		09990	  inspec:- filspc(editin,8R121101 000001);
		10020	  scanto(inspec,':');
		10050	  indevice:- inspec.sub(1,inspec.pos-1);
		10080	  scanto(inspec,'[');
		10110	  otherppn:= inspec.more;
		10140	  inspec.setpos(1); scanto(inspec,'<');
		10170	  inprotect:- from(inspec,inspec.pos-1);
		10200	
		10230	  IF tmpoutfile THEN
B32		10260	  BEGIN COMMENT Use temporary name on the output file;
		10290	    IF otherppn THEN
B33		10320	  BEGIN COMMENT Input file not on the user PPN, put output file
		10350	    there;
		10380	      tempfilename:- arg[1];
		10410	      tempfilename.setpos(1); scanto(tempfilename,'[');
		10440	      IF tempfilename.more THEN
B34		10470	      BEGIN tempfilename.setpos(tempfilename.pos-1);
		10500	        scanto(tempfilename,']'):= NOTEXT;
		10530	        tempfilename.sub(tempfilename.pos-3,2):= "[,";
E34		10560	      END ELSE tempfilename:- conc(tempfilename,"[,]");
		10590	      arg[1]:- tempfilename;
		10620	      tmpoutfile:= FALSE;
		10650	      IF findinfile(tempfilename) =/= NONE THEN
		10680	      overwritewarning(tempfilename);
E33		10710	    END ELSE
B35		10740	    BEGIN
		10770	      arg[1]:- tmpnam("VIT");
E35		10800	    END;
E32		10830	  END;
		10831
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   10
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		10860	  COMMENT Read first line to check for line numbers;
		10890	  editin.inimage;
		10920	  numbered_infile:= numbered AND arg[3] NE "NUL:NUL";
		10950	  largest_line_number:= last_line_number:= 0;
		10980	  IF arg[6] =/= NOTEXT THEN
B36		11010	  BEGIN
		11040	    arg[6].setpos(1);
		11070	    IF NOT digit(arg[6].getchar) THEN arg[6]:- rest(arg[6]);
		11100	    increment:= scanint(arg[6]);
		11130	    IF increment < 0 OR increment > 9999 THEN increment:= 10;
E36		11160	  END;
		11190	  IF numbered_infile AND increment = 0 THEN increment:= 2;
		11220	  IF arg[7] =/= NOTEXT THEN increment:= 0;
		11250	
		11280	  tempfilename:- arg[1];
		11310	  IF tmpoutfile THEN
B37		11340	  BEGIN COMMENT Create name of backup file;
		11370	    inspec.setpos(1); scanto(inspec,'.');
		11400	    IF inspec.more THEN
B38		11430	    BEGIN IF fetchar(inspec,inspec.pos) = 'Q' OR inspec.getchar = 'q'
		11460	      THEN
B39		11490	      BEGIN outtext("?VIDED - Cannot handle input file with '.Q': ");
		11520	        outtext(inspec); outimage;
		11550	        GOTO start;
E39		11580	      END;
E38		11610	    END;
		11640	
		11670	    c:= fetchar(inprotect,2);
		11700	    IF c > '2' AND c NE '4' THEN
B40		11730	    BEGIN outtext("?VIDED - Cannot overwrite file: ");
		11760	      outtext(inspec); outimage;
		11790	      outtext("%VIDED - Type ""CONTINUE"" if you think it will work.");
		11820	      outimage; exit(0);
E40		11850	    END;
		11880	
		11910	    COMMENT Set protection of temporary output file;
		11940	    tempfilename.setpos(1);
		11970	    IF scanto(tempfilename, '<').length >= tempfilename.length THEN
B41		12000	    BEGIN COMMENT no protection given by the user;
		12030	      tempfilename:- conc(tempfilename,"<077>");
E41		12060	    END;
		12090	
		12120	    COMMENT Set device for temporary output file;
		12150	    tempfilename.setpos(1); IF scanto(tempfilename,
		12180	    ':').length >= tempfilename.length THEN
B42		12210	    BEGIN COMMENT no device given by the user;
		12240	      tempfilename:- conc(indevice,tempfilename);
E42		12270	    END;
E37		12300	  END;
		12330	
		12360	  COMMENT Numbered outfile?;
		12390	  IF increment > 0 THEN tempfilename:- conc(tempfilename,"/NUMBERED");
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  10-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		12420	
		12450	  editout:- findoutfile(tempfilename);
		12480	  arg[1]:- tempfilename;
		12510	  IF editout == NONE THEN
B43		12540	  BEGIN outtext("?VIDED - CANNOT OPEN OUTPUT FILE: "); outtext(arg[1]);
		12570	    outimage; exit(0);
		12600	    GOTO start;
E43		12630	  END;
		12660	
		12690	COMMENT%IF debugterminal
		12720	debug:= arg[4] =/= NOTEXT;
		12750	  COMMENT%IFEND debugterminal;
		12751
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   11
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		12780	  IF the_editor == NONE THEN
B44		12810	  BEGIN
		12840	    IF arg[8] =/= NOTEXT THEN warningheight:= scanint(arg[8]) ELSE
		12870	    warningheight:= 56;
		12900	    IF arg[9] =/= NOTEXT THEN leftmargin:= scanint(arg[9]) ELSE
		12930	    leftmargin:= IF increment = 0 THEN 5 ELSE 13;
		12960	    IF arg[10] =/= NOTEXT THEN rightmargin:= scanint(arg[10]) ELSE
		12990	    rightmargin:= IF increment = 0 THEN 72 ELSE 78;
E44		13020	  END;
		13050	
		13080	  IF increment > 0 AND leftmargin < 8 THEN leftmargin:= 8;
		13110	  COMMENT ask user about terminal type if not known;
		13140	  gettype:
		13170	  IF the_editor == NONE THEN
B45		13200	  BEGIN
		13230	    INSPECT NEW termty DO
B46		13260	    BEGIN
		13290	      IF arg[2] == NOTEXT THEN asktype:
B47		13320	      BEGIN TEXT answer;
		13350	        type_menu(sysout);
		13380	        outtext("(Other) display."); outimage;
		13410	        inloop: outchr(sysout,'>',1); forceout(sysout);
		13440	        inimage;
		13470	        answer:- copy(storbokstav(sysin.image.strip));
		13500	        arg[2]:- scanto(answer,'/'); answer:- rest(answer);
		13530	        IF answer = "DCA" THEN
B48		13560	        BEGIN arg[18]:- blanks(1); arg[19]:- NOTEXT;
E48		13590	        END ELSE IF answer = "-DCA" THEN
B49		13620	        BEGIN arg[18]:- NOTEXT; arg[19]:- blanks(1);
E49		13650	        END;
		13680	        IF arg[2] == NOTEXT THEN GOTO inloop;
E47		13710	      END;
		13740	      IF NOT meny(arg[2],terminaltype,tr,termtype) THEN
B50		13770	      BEGIN
		13800	        outtext(IF terminaltype = -1 THEN
		13830	        "Ambiguous terminal type: " ELSE
		13860	        "Unknown terminal type: "); outtext(arg[2]); outimage;
		13890	        GOTO asktype;
E50		13920	      END;
		13950	      IF terminaltype = termtype THEN terminaltype:= 0;
		13980	      sysin.setpos(0);
		14010	
		14040	      IF arg[14] =/= NOTEXT THEN width:= scanint(arg[14]) ELSE
B51		14070	      BEGIN width:= cdefault(terminaltype);
		14100	        IF width = 0 THEN
B52		14130	        BEGIN again: outimage;
		14160	          outtext("Input terminal screen width: "); breakoutimage;
		14190	          inimage; width:= scanint(sysin.image);
		14220	          IF sysin.image.pos = 1 THEN
B53		14250	          BEGIN outtext("?VIDED - Unrecognizable integer");
		14280	            GOTO again;
E53		14310	          END;
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  11-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		14340	          width:= width-1;
E52		14370	        END;
E51		14400	      END;
		14430	
		14460	      IF arg[13] =/= NOTEXT THEN height:= scanint(arg[13]) ELSE
B54		14490	      BEGIN height:= ldefault(terminaltype);
		14520	        IF height = 0 THEN
B55		14550	        BEGIN
		14580	          again2: outtext("Input terminal screen height: ");
		14610	          breakoutimage;
		14640	          inimage; height:= scanint(sysin.image);
		14670	          IF sysin.image.pos = 1 THEN
B56		14700	          BEGIN outtext("?VIDED - unrecognizable integer."); outimage;
		14730	            GOTO again2;
E56		14760	          END;
E55		14790	        END;
E54		14820	      END;
E45		14850	  END of asktype, inspect new temty; END;
		14880	
		14910	  IF arg[27] =/= NOTEXT THEN giventrmspeed:= scanint(arg[27]);
		14911
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   12
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		14940	  COMMENT Open output text file for edited results;
		14970	  editout.open(blanks(IF increment = 0 THEN width ELSE width+8));
		15000	
		15030	COMMENT%IF debugterminal
		15060	IF debug THEN
		15090	BEGIN
		15120	  newsysin:- NEW infile("sysin *");
		15150	  COMMENT%IF debugterminal
		15180	  newsysout:- NEW outfile("sysout *");
		15210	  COMMENT%IF debugterminal
		15240	  newsysin.open(blanks(80));
		15270	  COMMENT%IF debugterminal
		15300	  newsysout.open(blanks(80))
		15330	END ELSE
		15360	BEGIN
		15390	  newsysin:- sysin;
		15420	  COMMENT%IF debugterminal
		15450	  newsysout:- sysout
		15480	END;
		15510	  COMMENT%IFEND debugterminal;
		15540	
		15570	  IF width < 11 THEN
B57		15600	  BEGIN outtext("?VIDED - Screen width must be > 10");
		15630	    outimage; exit(0);
E57		15660	  END;
		15690	
		15720	  COMMENT Write VIDED command and file name onto TMP:EDS;
		15750	  IF NOT merrygoround THEN
B58		15780	  BEGIN
		15810	    IF command == NOTEXT THEN
B59		15840	    BEGIN command:- blanks(width);
		15870	      belowcommand:- blanks(width);
E59		15900	    END;
		15930	    IF tmpoutfile THEN outfilename:- arg[3] ELSE
B60		15960	    BEGIN
		15990	      outfilename:- arg[1]; outfilename.setpos(1);
		16020	      outfilename:- scanto(outfilename,'/');
E60		16050	    END;
		16080	    puttext(belowcommand,"VIDED ");
		16110	    puttext(belowcommand,outfilename);
		16140	    belowcommand.putchar(char(10)); ! line feed;
		16170	    tmpout("EDS",copy(belowcommand.strip));
		16200	    belowcommand.setpos(belowcommand.pos-1);
		16230	    belowcommand.putchar(char(32));
E58		16260	  END;
		16261
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   13
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		16290	  IF arg[15] =/= NOTEXT THEN
B61		16320	  BEGIN
		16350	    IF arg[15].length = 1 THEN
		16380	    dot:= char(1) ELSE
B62		16410	    BEGIN
		16440	      arg[15].setpos(2); dot:= arg[15].getchar;
E62		16470	    END;
E61		16500	  END;
		16530	
		16560	  IF arg[26] =/= NOTEXT THEN ! /AUTOBACKUP;
B63		16590	  BEGIN arg[26].setpos(2);
		16620	    autobackup:= scanint(arg[26]);
		16650	    IF autobackup < 0 THEN autobackup:= 10;
E63		16680	  END ELSE autobackup:= 20;
		16710	  autobackcount:= IF autobackup = 0 THEN -3000000000 ELSE 0;
		16740	
		16770	  IF arg[17] == NOTEXT THEN showdefault:= height ELSE
B64		16800	  BEGIN arg[17].setpos(1);
		16830	    showdefault:= scanint(arg[17]);
		16860	    IF arg[17].pos = 1 THEN showdefault:= height;
E64		16890	  END;
		16920	  IF arg[16] =/= NOTEXT THEN dot:= char(127);
		16950	
B65		16955	  BEGIN TEXT extension;
		16960	    outfilename.setpos(1); scanto(outfilename,'.');
		16965	    extension:- rest(outfilename); extension:- upto(extension,4);
		16970	    storbokstav(extension);
		16975	
		17220	    IF dot = char(0) THEN
B66		17250	    BEGIN
		17280	      IF extension = "GNO" THEN dot:= '%'
		17310	      ELSE IF extension = "OVH" THEN dot:= '1'
		17340	      ELSE IF upto(extension,3) = "RN" THEN dot:= '.';
E66		17370	    END;
		17400	
		17430	    IF arg[23] == NOTEXT AND extension = "SWE" OR extension = "VIS"
		17460	    THEN arg[23]:- key[3];
		17462	
		17464	    IF upto(extension,3) = "VI" THEN
B67		17466	    BEGIN videdp:= TRUE; pageheight:= warningheight*1.5;
E67		17468	    END ELSE pageheight:= warningheight;
		17469
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   14
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		17475	  COMMENT Shall VIDED produce headers and page numbers?;
		17480	  IF arg[11] =/= NOTEXT THEN pageheader:= TRUE ELSE
		17490	    IF arg[12] =/= NOTEXT THEN pageheader:= FALSE ELSE
B68		17520	    BEGIN COMMENT these extensions give no page numbers;
		17550	      pageheader:=
		17580	      extension NE "INI" AND
		17610	      extension NE "SIM" AND
		17640	      extension NE "ALG" AND
		17670	      extension NE "B10" AND
		17700	      extension NE "B11" AND
		17730	      extension NE "BAS" AND
		17760	      extension NE "BLI" AND
		17790	      extension NE "CCL" AND
		17820	      extension NE "MIC" AND
		17850	      extension NE "FOR" AND
		17880	      extension NE "OVH" AND
		17910	      extension NE "F4" AND
		17940	      extension NE "GNO" AND
		17970	      extension NE "LAP" AND
		18000	      extension NE "LOG" AND
		18030	      extension NE "LST" AND
		18060	      extension NE "LSP" AND
		18090	      extension NE "MAC" AND
		18120	      extension NE "P11" AND
		18150	      extension NE "PL1" AND
		18180	      extension NE "RNO" AND
		18210	      extension NE "RNM" AND
		18240	      extension NE "RNH" AND
		18270	      extension NE "RNP" AND
		18300	      extension NE "SNO" AND
		18330	      extension NE "SRC" AND
		18360	      extension NE "ADR" AND
		18390	      extension NE "TEC";
		18420	      IF NOT pageheader THEN
B69		18450	      BEGIN COMMENT programming language extension and no /mp;
		18480	        IF dot = char(0) THEN dot:= char(127);
		18510	        IF arg[8] == NOTEXT THEN pageheight:= 150;
E69		18540	      END;
E65		18570	  END; END;
		18600	
		18630	  IF dot = char(0) THEN dot:= '.';
		18660	
		18690	  IF height < 2 THEN
B70		18720	  BEGIN outtext("?VIDED- Screen height must be > 1"); outimage;
		18750	    exit(0);
E70		18780	  END;
		18810	  COMMENT Get access to the editing facilities in vided1 and ;
		18840	  !z_t(-18);
E9		18870	END of procedure before_editing;
		18871
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   15
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		18900	vided2x CLASS vided3x;
B71		18930	BEGIN
		18960	
		18990	  TEXT old_search_string; ! &S& and &N& makes the same search
		19020	                            as previous search command;
		19050	  TEXT dashblank; ! Used by &- command;
		19080	
		19110	  PROCEDURE help;
B72		19140	  BEGIN COMMENT &H VIDED command;
		19170	    blankterminal;
		19200	    IF NOT helptype(heightm1,FALSE) THEN
		19230	    warning("Cannot find VIDED.HLP",NOTEXT);
		19260	    to_continue; command_done:= TRUE;
E72		19290	  END;
		19291
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   16
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		19320	  PROCEDURE avstava(nlines,evenmargin);
		19350	  COMMENT &J- and &F- VIDED commands;
		19380	  INTEGER nlines; BOOLEAN evenmargin;
		19410	  IF q_verticalpos > 0 THEN
B73		19440	  BEGIN
		19470	    IF q_horizontalpos > 0 THEN
B74		19500	    BEGIN IF
		19530	      get_char_from_screen(q_horizontalpos-1,q_verticalpos)
		19560	      = '-'
		19590	      THEN GOTO dash_is_there;
E74		19620	    END;
		19650	    IF get_char_from_screen(q_horizontalpos,q_verticalpos) = '-'
		19680	    THEN
B75		19710	    BEGIN move_the_cursor_to(q_horizontalpos+1,q_verticalpos);
		19740	      GOTO dash_is_there;
E75		19770	    END;
		19800	    insert(dashblank,FALSE);
		19830	    IF FALSE THEN dash_is_there: insert(dashblank.sub(2,1),FALSE);
		19860	    move_the_cursor_to(leftmargin,q_verticalpos-1);
		19890	    justify(nlines,evenmargin,TRUE);
E73		19920	  END ELSE warning("&J- or & F- not possible on top line.",NOTEXT);
		19950	
		19980	  PROCEDURE dobackup; ! &FB command action;
B76		20010	  BEGIN
		20040	    IF nooutput THEN badscreen:= TRUE;
		20070	    WHILE screen[0].sub(1,page_end_marker.length) =
		20100	    page_end_marker DO z_scroll(1);
		20130	    backupchecksum:= checksum;
		20160	    backuphor:= q_horizontalpos; backupvert:= q_verticalpos;
		20190	    backupzscroll:= top_fill; startpage:= out_pagenumber-1;
		20220	    IF NOT addff AND startpage > 0 THEN startpage:= startpage-1;
		20250	    backupsubpage:= sub_page_number; pagebottom:= FALSE;
		20280	    IF backupsubpage > 1 AND backupzscroll = -1 THEN
B77		20310	    BEGIN backupsubpage:= backupsubpage-1;
		20340	      backupzscroll:= top_size;
E77		20370	    END;
		20400	    backuping:= TRUE; GOTO roundabout;
E76		20430	  END of procedure dobackup;
		20431
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   17
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		20460	  PROCEDURE print_status;
		20490	  COMMENT &O VIDED command;
		20520	  INSPECT sysin DO INSPECT sysout DO
B78		20550	  BEGIN
		20580	    REF (qregister) current_q;
		20610	    TEXT qname; INTEGER i;
		20640	    blankterminal;
		20670	    outtext("VIDED STATUS INFORMATION:"); outimage;
		20700	    outtext("You are editing page no"); outint(pagenumber,4);
		20730	    outtext("(input),"); outint(out_pagenumber,4);
		20760	    outtext("(output).");
		20790	    IF sub_page_number > 1 THEN
B79		20820	    BEGIN outtext(" Subpage:"); outint(sub_page_number,3);
E79		20850	    END;
		20880	    outimage;
		20910	    outtext("Screen is showing line no.");
		20940	    outint(top_fill+2,3); outtext(" -");
		20970	    outint(top_fill+2+heightm1,3); outtext(" of current page.");
		21000	    outimage;
		21030	    outtext("Page height ="); outint(pageheight,3);
		21060	    outchar('.');
		21090	    IF pageheader THEN
B80		21120	    BEGIN
		21150	      outtext(" Title and subtitle of previous page:");
		21180	      outimage; outtext(header); outimage;
		21210	      outtext(sub_header);
E80		21240	    END;
		21270	    outimage;
		21300	    outtext("Current cursor position, horizontal =");
		21330	    outint(q_horizontalpos,3);
		21360	    outtext(", vertical ="); outint(q_verticalpos,3);
		21390	    outchar('.'); outimage;
		21420	    outtext("Input file """); outtext(arg[3]);
		21450	    outtext(""", "); IF tmpoutfile THEN outtext("temporary ");
		21480	    outtext("output file """); outtext(arg[1]);
		21510	    outtext(""".");
		21540	    outimage;
		21570	    IF tmpoutfile THEN
B81		21600	    BEGIN
		21630	      outtext("Output file will be renamed to """);
		21660	      outtext(arg[3]); outtext("""."); outimage;
E81		21690	    END;
		21720	    outtext("You are ");
		21750	    IF NOT endpage OR NOT lower_lines == NONE THEN
		21780	    outtext("not ");
		21810	    outtext("at the end of a page.");
		21840	    outimage; outtext("You are ");
		21870	    IF NOT editin.endfile OR NOT lower_lines == NONE
		21900	    THEN outtext("not ");
		21930	    outtext("at the end of the file.");
		21960	    outimage;
		21990	    outtext("Left margin ="); outint(leftmargin,3);
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  17-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		22020	    outtext("  Right margin ="); outint(rightmargin,3);
		22050	    outimage;
		22080	    IF qregisters == NONE THEN
B82		22110	    BEGIN outtext("You have no Q-registers."); outimage;
		22140	      to_continue;
E82		22170	    END ELSE
B83		22200	    BEGIN
		22230	      IF NOT q_echoenabled THEN echon;
		22260	      qlist:
		22290	      outtext("Width  Height  Q-register name"); outimage;
		22320	      current_q:- qregisters;
		22350	      WHILE current_q =/= NONE DO
B84		22380	      BEGIN
		22410	        outint(current_q.qwidth,4);
		22440	        outint(current_q.qheight,7); image.setpos(16);
		22470	        outtext(current_q.qname); outimage;
		22500	        current_q:- current_q.next_qregister;
E84		22530	      END;
		22560	      again:
		22590	      outtext(
		22620	      "If you want to see the contents of a Q-register,");
		22650	      outtext(" then type its name:"); outimage;
		22680	      inimage; qname:- storbokstav(sysin.image.strip);
		22710	      IF qname =/= NOTEXT THEN
		22740	      INSPECT find_qregister(qname) DO
B85		22770	      BEGIN
		22800	        FOR i:= 1 STEP 1 UNTIL qheight DO
B86		22830	        BEGIN outtext(lines(i-1)); outimage;
E86		22860	        END;
		22890	        GOTO again;
E85		22920	      END OTHERWISE
B87		22950	      BEGIN outtext("?VIDED - There is no such Q-register."
		22980	        " Push RETURN to exit.");
		23010	        outimage; GOTO qlist;
E87		23040	      END;
		23070	      restore_screen(q_verticalpos, showdefault);
E83		23100	    END; command_done:= TRUE;
E78		23130	  END;
		23131
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   18
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		23160	  PROCEDURE getcommand(simulated_command);
		23190	  VALUE simulated_command; TEXT simulated_command;
		23220	  COMMENT Interpret VIDED command, this procedure is called when the
		23250	  user has typed <ALTMODE> or <CONTROL-F> to start a VIDED command;
B88		23280	  BEGIN BOOLEAN stoptime; ! Time to exit from "getcommand";
		23310	    BOOLEAN anytextparameter; ! Interpreting the part of a VIDED
		23340	    command such as &Q or &S which has a text parameter;
		23370	    BOOLEAN type_ahead; ! The user has done type_ahead;
		23400	    BOOLEAN got_digit; ! Explicit user digit was input;
		23430	    BOOLEAN signed; ! There was a + or - sign on the digit;
		23460	    CHARACTER commandchar; ! First nonnumeric character after &;
		23490	    CHARACTER oldchar; ! Screen character overwritten by command
		23520	    character;
		23550	    CHARACTER secondchar; ! Second character in VIDED command;
		23580	    INTEGER hstart; ! Horizontal pos of &;
		23610	    INTEGER vstart; ! Vertical pos of &;
		23640	    INTEGER arg1; ! First numerical parameter to the command;
		23670	    INTEGER arg2; ! Second numerical parameter to the command;
		23700	    INTEGER leading_number; ! Number given by the user before the
		23730	    command character, e.g. in &13V;
		23760	    INTEGER multi; ! Number of times this command is to be repeated;
		23790	    INTEGER multic; ! Counter of iterations from 1 to multi;
		23820	    INTEGER multistep; ! step between lines with multi application;
		23850	    INTEGER vtop; ! One less than the top line to be modified;
		23880	    INTEGER stringstart; ! Startpos of text param to I, Q etc;
		23910	    INTEGER intpos; ! startpos of integer being read;
		23940	    TEXT qname; ! Value of text parameter to VIDED command;
		23941
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   19
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		23970	    PROCEDURE checkvalue(arg,min);
		24000	    INTEGER arg, min;
		24030	    IF arg < min THEN
B89		24060	    BEGIN warning("Too small numerical parameter.",NOTEXT);
		24090	      commandchar:= char(0); GOTO endcommand;
E89		24120	    END;
		24150	
		24180	    INTEGER PROCEDURE intin;
		24210	    COMMENT read integer parameter to VIDED command;
		24240	    IF leading_number NE -100000 THEN
B90		24270	    BEGIN intin:= leading_number; leading_number:= -100000;
E90		24300	    END ELSE
B91		24330	    BEGIN TEXT digpart;
		24360	      intpos:= command.pos;
		24390	      signed:= nextchar = '-' OR q_gotchar = '+';
		24420	      IF signed OR digit(q_gotchar) THEN
B92		24450	      BEGIN
		24480	        WHILE digit(nextchar) DO;
E92		24510	      END;
		24540	      IF q_gotchar = carriagereturn THEN
		24570	      command.putchar(q_gotchar);
		24600	      IF intpos+1 >= command.pos THEN
B93		24630	      BEGIN got_digit:= FALSE;
		24660	        intin:= (IF commandchar = char(0) THEN -100000 ELSE IF
		24690	        commandchar = 'M' THEN hstart ELSE IF commandchar = 'F' THEN 0
		24720	        ELSE IF commandchar = 'T' THEN -1000 ELSE 1)
E93		24750	      END ELSE
B94		24780	      BEGIN got_digit:= TRUE;
		24810	        digpart:- command.sub(intpos,command.pos-intpos-1);
		24840	        IF digpart.length > 6 THEN
B95		24870	        BEGIN warning("Too large integer parameter.",NOTEXT);
		24900	          commandchar:= char(0); GOTO endcommand;
E95		24930	        END;
		24960	        intin:= IF NOT signed OR digpart.length > 1 THEN
		24990	        digpart.getint ELSE IF digpart = "-" THEN -1 ELSE 1;
E94		25020	      END;
E91		25050	    END;
		25051
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   20
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		25080	    PROCEDURE take_line_feed;
B96		25110	    BEGIN IF vstart >= heightm1 THEN
B97		25140	      BEGIN call(p_scroll);
		25170	        vstart:= vstart-1;
		25200	        verybadscreen:= type_ahead;
E97		25230	      END;
E96		25260	    END;
		25290	
		25320	    PROCEDURE restore_command;
		25350	    COMMENT When the user has ended a VIDED command, the screen is
		25380	    restored to what it was below the command before it was typed;
B98		25410	    BEGIN
		25440	      IF q_gotchar = carriagereturn THEN
		25470	      COMMENT%IFNOT CALLMAC
		25500	      call(p_insingle) ELSE
		25530	      COMMENT%IF CALLMAC;
		25560	      vtisng(cpunumber) ELSE
		25590	      COMMENT%IFEND CALLMAC;
B99		25595	      IF controlchar AND q_gotchar >= ' ' THEN BEGIN
B100		25600	        IF trmop(8R001,sysout,1) = 1 THEN BEGIN
		25603	          loop: getch; IF trmop(8R001,sysout,1) = 1 THEN GOTO loop;
		25605	          warning("Use RETURN key to finish VIDED COMMAND.",
		25610	          NOTEXT);
E100		25613	        END;
E99		25615	      END;
		25620	      COMMENT%IF VIDTIM
		25650	      outchr(vidtim,q_gotchar,1);
		25680	      COMMENT%ENDIF VIDTIM;
		25710	      COMMENT%IF debugslow
		25740	      IF debugslow > 0 THEN sleep(debugslow);
		25770	      COMMENT%IFEND debugslow;
		25800	      normaltext;
		25830	      IF q_gotchar = linefeed THEN take_line_feed;
		25860	      synchronize(hstart,vstart);
		25890	      outtext(front(belowcommand));
		25920	      move_the_cursor_to(hstart,vstart);
		25950	      COMMENT%IF STAT
		25980	      stat.outtext(front(command));
		26010	      COMMENT%IF STAT
		26040	      stat.outimage;
		26070	      COMMENT%IFEND stat;
E98		26100	    END;
		26101
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   21
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		26130	    CHARACTER PROCEDURE nextchar;
B101		26160	    BEGIN COMMENT Input of one character in a VIDED command;
		26190	      IF stoptime THEN
B102		26220	      BEGIN
		26250	        IF badscreen THEN verybadscreen:= TRUE;
		26280	        warning("End of line, command stopped.",NOTEXT);
		26310	        GOTO endcommand;
E102		26340	      END;
		26370	      stoptime:= q_horizontalpos = widthm1;
		26400	      start: oldchar:=
		26430	      get_char_from_screen(q_horizontalpos,q_verticalpos);
		26460	      IF simulated_command.more
B103		26490	      THEN BEGIN
		26520	        q_gotchar:= simulated_command.getchar;
		26550	        outchar(q_gotchar); controlchar:= FALSE;
E103		26580	      END ELSE
		26610	      COMMENT%IFNOT CALLMAC
		26640	      call(p_insingle);
		26670	      COMMENT%IF CALLMAC;
		26700	      vtisng(cpunumber);
		26730	      COMMENT%IFEND CALLMAC;
		26760	      nextchar:= q_gotchar;
		26790	      COMMENT%IF VIDTIM
		26820	      outchr(vidtim,q_gotchar,1);
		26850	      COMMENT%IFEND VIDTIM;
		26880	      COMMENT%IF debugslow
		26910	      IF debugslow > 0 THEN sleep(debugslow);
		26940	      COMMENT%IFEND debugslow;
		26970	      IF q_gotchar = fill OR controlchar AND q_gotchar = left THEN
B104		27000	      BEGIN
		27030	        IF command.pos > 3 AND command.pos >= intpos THEN
B105		27060	        BEGIN
B106		27090	          IF q_echoenabled THEN BEGIN
B107		27120	            IF q_gotchar = left THEN BEGIN
		27150	              IF addaltmode AND NOT leftsingle THEN
		27180	              outchr(terminalout,altmode,1);
		27210	              outchr(terminalout,left,1);
E107		27240	            END;
		27270	            q_display_output:= FALSE;
		27300	            outstring(terminalout,deletechar);
E106		27330	          END;
		27360	          outchar(fetchar(belowcommand,belowcommand.pos-1));
		27390	          move_the_cursor_to(q_horizontalpos-1,q_verticalpos);
		27420	          q_display_output:= TRUE;
		27450	          command.setpos(command.pos-1);
		27480	          belowcommand.setpos(belowcommand.pos-1);
		27510	          GOTO start;
E105		27540	        END ELSE
B108		27570	        BEGIN commandchar:= char(0); GOTO endcommand;
E108		27600	        END;
E104		27630	      END ELSE
		27660	      IF q_gotchar = control_u THEN ! erase command;
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  21-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

B109		27674	      BEGIN IF NOT q_echoenabled
B110		27678	        THEN commandchar:= char(0) ELSE BEGIN
		27680	          normaltext;
		27682	          screen(vstart).sub(hstart+1,belowcommand.pos-3):=
		27684	          belowcommand.sub(3,belowcommand.pos-3);
		27686	          restore_lines(vstart,vstart);
		27688	          command.setpos(1);
E110		27691	        END; GOTO endcommand;
E109		27720	      END ELSE
B111		27750	      BEGIN
		27780	        IF controlchar THEN
B112		27810	        BEGIN
		27840	          IF q_gotchar = altmode THEN
		27870	          outchr(terminalout,delayer,1);
		27900	          IF q_gotchar NE carriagereturn AND
		27930	          anytextparameter THEN GOTO endcommand;
		27960	          IF q_gotchar NE carriagereturn AND
		27990	          q_gotchar NE control_f AND q_gotchar NE comstartchar AND
		28020	          q_gotchar NE altmode THEN
B113		28050	          BEGIN ! illegal char; commandchar:= char(0);
		28080	            GOTO endcommand;
E113		28110	          END;
E112		28140	        END ELSE
B114		28170	        BEGIN
B115		28200	          IF q_echoenabled THEN BEGIN
		28230	            outstring(terminalout,insertchar);
		28260	            outchr(terminalout,q_gotchar,1);
E115		28290	          END;
		28320	          belowcommand.putchar(oldchar);
		28350	          command.putchar(q_gotchar);
E114		28380	        END;
E111		28410	      END;
E101		28440	    END;
		28441
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   22
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		28470	    PROCEDURE adjustmulti;
B116		28500	    BEGIN
		28530	      vtop:= vstart-1;
		28560	      IF multi < 0 THEN
B117		28590	      BEGIN
		28620	        IF screen[vstart].sub(1,1) NE "." THEN
		28650	        multi:= height-vstart ELSE
B118		28680	        BEGIN
		28710	          FOR vtop:= vstart STEP -1 UNTIL 0 DO
		28740	          IF screen[vtop].sub(1,1) NE "." THEN GOTO exit1;
		28770	          vtop:= -1;
		28800	          exit1:
		28830	          FOR multi:= vstart STEP 1 UNTIL heightm1 DO
		28860	          IF screen[multi].sub(1,1) NE "." THEN GOTO exit2;
		28890	          multi:= multi+1;
		28920	          exit2: multi:= multi-vtop-1;
E118		28950	        END;
E117		28980	      END;
		29010	      IF multi > heightm1-vtop THEN multi:= heightm1-vtop;
E116		29040	    END;
		29055	
		29070	    PROCEDURE get_line_feed;
B119		29100	    IF getch = linefeed THEN BEGIN
		29130	      type_ahead:= FALSE; normaltext; take_line_feed; specialtext;
E119		29160	    END;
		29161
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   23
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		29220	    COMMENT body of PROCEDURE getcommand; !z_t(19);
		29250	    hstart:= q_horizontalpos; vstart:= q_verticalpos;
		29280	    vtop:= vstart-1; command_done:= FALSE;
		29310	    command:= "&"; command.setpos(2);
		29340	    IF q_horizontalpos > widthm1 THEN GOTO getout;
		29370	    belowcommand:=
		29400	    screen(q_verticalpos).sub(q_horizontalpos+1,1);
		29430	    belowcommand.setpos(2);
		29460	    type_ahead:= trmop(8R0001,sysout,1) = 1 !=type ahead;;
B120		29490	    IF terminaltype = volker414h THEN BEGIN
		29520	      IF volkeomchar NE char(0) AND
		29550	      (q_gotchar = 'A' OR simulated_command =/= NOTEXT) THEN
B121		29580	      BEGIN IF getch = carriagereturn THEN get_line_feed;
E121		29610	      END;
E120		29640	    END ELSE IF terminaltype = elite3025 AND
		29670	    (q_gotchar = 'p' OR simulated_command =/= NOTEXT)
B122	E122	29700	    THEN BEGIN getch; get_line_feed; END;
		29707	    COMMENT%IF debugslow
		29716	    sleep(1);
		29723	    COMMENT%IFEND debugslow;
		29730	    echoff; synchronize(hstart,vstart);
		29760	    specialtext;
		29790	    outchr(sysout,delayer,1); outchar('&');
		29820	    IF hstart >= widthm1 THEN GOTO endcommand;
		29850	    multi:= 1; stringstart:= 3;
		29880	    readcommand: leading_number:= -100000;
		29910	    leading_number:= intin;
		29940	    commandchar:= q_gotchar;
		29970	    COMMENT storbokstav commandchar;
		30000	    IF commandchar >= 'a' THEN
		30030	    commandchar:= char(rank(commandchar)-32) ELSE
		30060	    IF controlchar THEN commandchar:= char(0);
		30090	
		30120	    COMMENT test for each possible first command character;
		30150	    IF commandchar = '*' THEN
B123		30180	    BEGIN multi:= leading_number; stringstart:= command.pos+1;
		30210	      commandchar:= char(0); GOTO readcommand;
E123		30240	    END;
		30270	    IF commandchar = '_' THEN
B124		30300	    BEGIN nooutput:= TRUE; commandchar:= char(0);
		30330	      GOTO readcommand;
E124		30360	    END;
		30390	    IF commandchar = 'R' THEN
B125		30420	    BEGIN restore_command;
		30450	      restore_screen(vstart, IF leading_number <= 0 THEN 998 ELSE
		30480	      -leading_number);
		30510	      command_done:= TRUE;
E125		30540	    END ELSE IF commandchar = 'W' THEN
B126		30570	    BEGIN restore_command; arg1:= IF leading_number < 0 THEN 1 ELSE
		30600	      leading_number;
		30630	      FOR multic:= 1 STEP 1 UNTIL arg1 DO removeword;
E126		30660	    END ELSE IF commandchar = '-' THEN
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  23-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

B127		30690	    BEGIN restore_command; warning("Use &J- or &F- commands.",NOTEXT);
E127		30720	    END ELSE IF commandchar = 'X' THEN
B128		30750	    BEGIN restore_command;
		30780	      IF leading_number = -100000 THEN
		30810	      arg1:= screen(vstart).strip.length ! &X;
		30840	      ELSE arg1:= width-frontstrip(screen[vstart].
		30870	      sub(first_text_pos+1,width-first_text_pos)).length; ! &-X;
		30900	      IF arg1 > widthm1 THEN arg1:= widthm1;
		30930	      move_the_cursor_to(arg1,vstart); command_done:= TRUE;
E128		30960	    END ELSE IF commandchar = 'O' THEN
B129		30990	    BEGIN restore_command; print_status;
E129		31020	    END ELSE IF commandchar = 'U' THEN
B130		31050	    BEGIN restore_command; adjustmulti;
		31080	      FOR multic:= 1 STEP 1 UNTIL multi DO
B131		31110	      BEGIN move_the_cursor_to(hstart,vtop+multic);
		31140	        blank_front;
E131		31170	      END; IF multi > 1 THEN move_the_cursor_to(hstart,vstart);
E130		31200	    END ELSE IF commandchar = 'E' THEN
B132		31230	    BEGIN restore_command; forceout(sysout); GOTO stopedit;
E132		31260	    END ELSE IF commandchar = 'C' THEN
B133		31290	    BEGIN restore_command; IF leading_number < 0 THEN control_c;
E133		31320	    END ELSE IF commandchar = 'V' THEN
B134		31350	    BEGIN arg1:= IF leading_number < 0 THEN 1 ELSE
		31380	      leading_number;
		31410	      IF arg1 > line_model.length THEN arg1:= 0;
		31440	      restore_command; adjustmulti;
		31470	      FOR multic:= 1 STEP 1 UNTIL multi DO
B135		31500	      BEGIN move_the_cursor_to(hstart,vtop+multic);
		31530	        insert(line_model.sub(1,arg1),FALSE);
E135		31560	      END;
		31590	      move_the_cursor_to(hstart,vstart);
E134		31620	    END ELSE IF commandchar = 'T' THEN
B136		31650	    BEGIN arg1:= intin; restore_command;
		31680	      IF arg1 < 0 AND arg1 >= -999 THEN
B137		31710	      BEGIN arg1:= width+arg1; checkvalue(arg1,0);
E137		31740	      END;
		31770	      IF arg1 > widthm1 THEN arg1:= widthm1;
		31800	      IF q_gotchar > ' ' AND q_gotchar NE 'T' AND q_gotchar NE 't'
		31830	      THEN settab(IF arg1 < 0 THEN hstart ELSE arg1,q_gotchar) ELSE
B138		31860	      BEGIN command_done:= TRUE;
		31890	        IF arg1 < 0 THEN position_tab(FALSE) ELSE
		31920	        move_the_cursor_to(arg1,vstart);
E138		31950	      END;
E136		31980	    END ELSE IF commandchar = 'L' THEN
B139		32010	    BEGIN IF leading_number >= 0 THEN
B140		32040	      BEGIN restore_command;
		32070	        addlines(leading_number,TRUE,FALSE,TRUE);
E140		32100	      END ELSE
B141		32130	      BEGIN
		32160	        got_digit:= FALSE; arg1:= intin; restore_command;
		32190	        checkvalue(arg1,1);
		32220	        IF q_gotchar = 'D' OR q_gotchar = 'd' OR
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  23-2
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		32250	        q_gotchar < ' ' THEN
		32280	        addlines(arg1,TRUE,q_gotchar > ' ',TRUE) ELSE
B142		32310	        BEGIN
		32340	          adjustmulti;
		32370	          FOR multic:= 1 STEP 1 UNTIL multi DO
B143		32400	          BEGIN move_the_cursor_to(hstart,vtop+multic);
		32430	            IF q_gotchar = 'n' OR q_gotchar = 'N'
		32460	            THEN numberlines(arg1)
		32490	            ELSE IF q_gotchar = 'C' OR q_gotchar = 'c'
		32520	            THEN center_line(IF got_digit THEN arg1 ELSE -1)
		32550	            ELSE IF q_gotchar = 'U' OR q_gotchar = 'u'
		32580	            OR q_gotchar = 'L' OR q_gotchar = 'l'
		32610	            THEN case_shift(q_gotchar);
E143		32640	          END of multic loop;
E142		32670	        END;
E141		32700	      END;
E139		32730	    END ELSE IF commandchar = 'M' THEN
B144		32760	    BEGIN secondchar:= nextchar;
		32790	      arg1:= intin; restore_command;
		32820	      margset(secondchar,arg1);
E144		32850	    END ELSE IF commandchar = 'J' OR commandchar = 'F' THEN
B145		32880	    BEGIN IF nextchar >= 'a' THEN
		32910	      q_gotchar:= char(rank(q_gotchar)-32);
		32940	      IF q_gotchar NE '-' AND
		32970	      (commandchar = 'J' AND q_gotchar NE 'U' OR
		33000	      commandchar = 'F' AND q_gotchar NE 'I' AND q_gotchar NE 'C')
		33030	      THEN
B146		33060	      BEGIN IF q_gotchar= carriagereturn THEN
B147		33090	        BEGIN
		33120	          COMMENT%IFNOT CALLMAC
		33150	          call(p_insingle);
		33180	          COMMENT%IF CALLMAC;
		33210	          vtisng(cpunumber);
		33240	          COMMENT%IFEND CALLMAC;
		33270	          q_gotchar:= char(0);
E147		33300	        END;
		33330	        IF q_gotchar = 'B' OR q_gotchar = 'b' THEN
B148		33360	        BEGIN COMMENT &FB = File Backup command;
		33390	          restore_command; dobackup;
E148		33420	        END ELSE
B149		33450	        BEGIN warning("Use &JU, &FI or &FC commands",NOTEXT);
		33480	          GOTO endcommand;
E149		33510	        END;
E146		33540	      END;
		33570	      arg1:= IF leading_number < 0 THEN
		33600	      0 ELSE leading_number; restore_command;
		33630	      adjustmulti;
		33660	      FOR multic:= 1 STEP 1 UNTIL multi DO
B150		33690	      BEGIN move_the_cursor_to(hstart,vtop+multic);
		33720	        IF q_gotchar = '-' THEN avstava(arg1,commandchar = 'J') ELSE
		33750	        justify(arg1,commandchar = 'J',q_gotchar NE 'I');
E150		33780	      END;
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  23-3
DSK:MIDED3.SIM	   7-APR-1979   8:36	

E145		33810	    END ELSE IF commandchar = 'Z' THEN
B151		33840	    BEGIN arg1:= intin;
		33870	      restore_command; z_scroll(arg1);
E151		33900	    END ELSE IF commandchar = 'D' THEN
B152		33930	    BEGIN arg1:= IF leading_number < 0 THEN 1 ELSE leading_number;
		33960	      restore_command; adjustmulti;
		33990	      FOR multic:= 1 STEP 1 UNTIL multi DO
B153		34020	      BEGIN move_the_cursor_to(hstart,vtop+multic);
		34050	        removechars(arg1);
E153		34080	      END; move_the_cursor_to(hstart,vstart);
E152		34110	    END ELSE IF commandchar = 'K' THEN
B154		34140	    BEGIN arg1:= IF leading_number < 0 THEN 1 ELSE leading_number;
		34170	      restore_command; adjustmulti;
		34200	      FOR multic:= 1 STEP 1 UNTIL multi DO
B155		34230	      BEGIN move_the_cursor_to(hstart,vtop+multic);
		34260	        IF q_horizontalpos = 0 AND q_verticalpos = 0 THEN
B156		34290	        BEGIN nooutput:= TRUE; z_scroll(arg1);
E156		34320	        END ELSE removelines(arg1);
E155		34350	      END; move_the_cursor_to(hstart,vstart);
E154		34380	    END ELSE IF commandchar = 'H' THEN
B157		34410	    BEGIN restore_command; help;
		34411
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   24
DSK:MIDED3.SIM	   7-APR-1979   8:36	

E157		34440	    END ELSE IF commandchar = 'P' THEN
B158		34470	    BEGIN IF leading_number NE -100000 THEN
B159		34500	      BEGIN arg1:= leading_number; nextchar;
E159		34530	      END ELSE arg1:= intin;
		34560	      IF NOT got_digit THEN
B160		34590	      BEGIN signed:= TRUE; arg1:= 0;
E160		34620	      END;
		34650	      restore_command;
		34680	      pagebottom:= q_gotchar = 'E' OR q_gotchar = 'e';
		34710	      IF q_gotchar = 'F' OR q_gotchar = 'f' THEN
		34740	      newpages(1000000,FALSE,TRUE) ELSE
		34770	      IF q_gotchar = 'A' OR q_gotchar = 'a' THEN
B161		34800	      BEGIN
		34830	        IF NOT (endpage OR editin.endfile) OR lower_lines =/= NONE
		34836	        THEN newpages(0,TRUE,FALSE);
		34861	        append_page;
E161		34890	      END
		34920	      ELSE IF q_gotchar = 'I' OR q_gotchar = 'i' THEN pagedivide
		34950	      ELSE IF q_gotchar = 's' OR q_gotchar = 'S' THEN
B162		34980	      BEGIN
		35010	        psearch:= TRUE; pbottom:= arg1;
		35040	        IF pbottom <= 1 THEN pbottom:= 10;
		35070	        pfound:= (endpage OR editin.endfile) AND lower_lines
		35100	        == NONE AND (IF videdp THEN videdpcount ELSE
		35114	        top_fill+heightm1) + pbottom < warningheight;
		35131	        IF NOT pfound THEN
		35160	        search_for(page_end_marker,'N',showdefault);
		35190	        IF pfound THEN warning(
		35220	        "Page with few lines found.",NOTEXT);
E162		35250	      END ELSE IF q_gotchar = 'O' OR q_gotchar = 'o' THEN
		35280	      warning("Have you written the letter O "
		35310	      "instead of the digit 0? ",NOTEXT)
		35340	      ELSE
B163		35370	      BEGIN COMMENT &PE, &PT, &P;
		35400	        IF q_gotchar < ' ' THEN
B164		35430	        BEGIN COMMENT &P command;
		35460	          IF NOT got_digit THEN arg1:= 1;
E164		35490	        END ELSE
B165		35520	        BEGIN
		35550	          IF NOT pagebottom AND q_gotchar NE 'T' AND q_gotchar NE 't'
		35580	          THEN GOTO endcommand; ! Neither &P nor &PE nor &PT;
		35610	          IF NOT signed AND arg1 NE 0 THEN
		35640	          arg1:= arg1-out_pagenumber; ! Absolute page no to relative;
E165		35670	        END;
		35700	        IF arg1 < 0 OR got_digit AND arg1 = 0 AND
		35730	        sub_page_number > 1 THEN
B166		35760	        BEGIN startpage:= arg1+out_pagenumber-1;
		35790	          IF sub_page_number > 1 THEN startpage:= startpage-1;
		35820	          GOTO roundabout;
E166		35850	        END ELSE
B167		35880	        BEGIN newpages(arg1,pagebottom,FALSE);
		35910	          IF NOT pagebottom AND sub_page_number > 1 THEN
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  24-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		35940	          warning("Cannot find top of large page.",
		35970	          "Push RETURN and write &-0PT to find real page top.");
E167		36000	        END;
E163		36030	      END;
		36031
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   25
DSK:MIDED3.SIM	   7-APR-1979   8:36	

E158		36060	    END ELSE IF commandchar = 'Q' THEN
B168		36090	    BEGIN
		36120	      arg2:= -100000; anytextparameter:= TRUE;
		36150	      WHILE letter(nextchar) OR digit(q_gotchar) DO;
		36180	      IF command.pos > (IF q_gotchar = carriagereturn THEN 3 ELSE 4)
		36210	      THEN qname:- copy(command.sub(3,command.pos-
		36240	      (IF q_gotchar = carriagereturn THEN 3 ELSE 4)));
		36270	      IF q_gotchar > ' ' OR qname == NOTEXT THEN commandchar:= null;
		36300	      anytextparameter:= FALSE;
		36330	      arg1:= IF q_gotchar < ' ' THEN 1 ELSE intin;
		36360	      IF q_gotchar = ' ' THEN arg2:= intin ELSE
B169		36390	      BEGIN arg2:= arg1; arg1:= 0;
E169		36420	      END;
		36450	      restore_command;
		36480	      qregistercall:
		36510	      checkvalue(arg1,0); checkvalue(arg2,0);
		36540	      IF qname = NOTEXT THEN
		36570	      qname:- warning( "You gave no qregister name.",NOTEXT)
		36600	      ELSE put_register(qname,arg1,arg2);
E168		36630	    END ELSE IF commandchar = 'A' THEN
B170		36660	    BEGIN
		36690	      arg1:= intin; arg2:= intin; restore_command;
		36720	      checkvalue(arg1,0); checkvalue(arg2,0);
		36750	      IF arg1 < width AND arg2 < height THEN
B171		36780	      BEGIN move_the_cursor_to(arg1,arg2); command_done:= TRUE;
E171		36810	      END;
E170		36840	    END ELSE IF commandchar = 'G' THEN
B172		36870	    BEGIN
		36900	      WHILE letter(nextchar) OR digit(q_gotchar) DO;
		36930	      IF q_gotchar = carriagereturn THEN
		36960	      command.setpos(command.pos+1);
		36990	      IF command.pos > stringstart+1 THEN
		37020	      qname:-
		37050	      copy(command.sub(stringstart,command.pos-stringstart-1));
		37080	      restore_command; adjustmulti;
		37110	      INSPECT find_qregister(qname) DO
B173		37140	      BEGIN multistep:= qheight;
		37170	        multi:= multi*multistep;
		37200	        FOR multic:= 1 STEP multistep UNTIL multi DO
		37230	        IF vtop + multic < height THEN
B174		37260	        BEGIN move_the_cursor_to(hstart,vtop+multic);
		37290	          get_register(THIS qregister);
E174		37320	        END; move_the_cursor_to(hstart,vstart);
E173		37350	      END;
E172		37380	    END ELSE IF commandchar = 'I' OR commandchar = 'S' OR
		37410	    commandchar = 'N' THEN
B175		37440	    BEGIN
		37470	      stringstart:= command.pos;
		37500	      anytextparameter:= TRUE;
B176		37530	      IF insertchar =/= NOTEXT AND commandchar = 'I' THEN BEGIN
		37560	        ! Advanced I action if insertchar code is available;
B177		37569	        IF trmop(8R0001,sysout,1) = 1 ! type ahead; THEN BEGIN
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  25-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		37576	          normaltext; restore_lines(vstart,vstart);
E177		37583	        END;
		37590	        restore_command; q_echoenabled:= TRUE; specialtext;
E176		37620	      END;
		37650	      WHILE TRUE DO nextchar;
E175		37680	    END ELSE
		37710	    endcommand:
B178		37740	    BEGIN COMMENT handling of end of &I, &Q, &S and &N commands,
		37770	      that is some of the commands taking nonnumerical parameters,
		37800	      also handling of some ununderstandable commands;
		37830	      IF insertchar == NOTEXT OR commandchar NE 'I'
B179		37860	      THEN restore_command ELSE BEGIN ! Advanced I action;
		37890	        q_echoenabled:= FALSE; normaltext;
		37920	        screen[vstart].sub(hstart+1,belowcommand.pos-stringstart):=
		37950	        belowcommand.sub(stringstart,belowcommand.pos-stringstart);
E179		37980	      END;
		38010	      IF commandchar = 'I' THEN
B180		38040	      BEGIN COMMENT &I<qname>& command;
		38070	        IF command.pos > stringstart THEN
		38100	        qname:- command.sub(stringstart,command.pos-stringstart);
		38130	        adjustmulti;
		38160	        FOR multic:= 1 STEP 1 UNTIL multi DO
B181		38190	        BEGIN move_the_cursor_to(hstart,vtop+multic);
		38220	          insert(qname,insertchar =/= NOTEXT AND multic = 1);
E181		38250	        END; IF multi > 1 THEN move_the_cursor_to(hstart,vstart);
E180		38280	      END ELSE IF commandchar = 'S' OR commandchar = 'N' THEN
B182		38310	      BEGIN COMMENT &nS<qname>& and &nN<qname>& command;
		38340	        IF command.pos > stringstart THEN
		38370	        qname:- command.sub(stringstart,command.pos-stringstart);
		38400	        IF qname = NOTEXT THEN
		38430	        qname:- old_search_string ELSE
B183		38460	        BEGIN oldnarg:= IF leading_number < 0 THEN showdefault
		38490	          ELSE leading_number;
		38520	          old_search_string:- copy(qname);
E183		38550	        END;
		38580	        psearch:= FALSE;
		38610	        FOR multic:= 1 STEP 1 UNTIL multi DO
B184		38640	        BEGIN search_for(qname,commandchar,oldnarg);
		38670	          IF multic < multi THEN
B185		38700	          BEGIN IF editin.endfile AND lower_lines == NONE THEN
		38730	            GOTO exit_nsearch;
E185		38760	          END;
E184		38790	        END;
		38820	        exit_nsearch:
E182		38850	      END ELSE
		38880	      IF commandchar = 'Q' THEN
B186		38910	      BEGIN COMMENT &Q<qname>& command;
		38940	        IF arg2 < 0 THEN
B187		38970	        BEGIN arg2:= arg1; arg1:= 0;
E187		39000	        END;
		39030	        IF qname == NOTEXT
		39060	        AND command.pos > stringstart THEN
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  25-2
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		39090	        qname:-
		39120	        copy(command.sub(stringstart,command.pos-stringstart));
		39150	        GOTO qregistercall;
E186		39180	      END;
E178		39210	    END;
		39240	    COMMENT End of the handling a VIDED command, ignore type ahead
		39270	    made by the user during the performance of the action of the
		39300	    VIDED command, and restore the screen if there was too much type
		39330	    ahead before the beginning of the handling of the VIDED command;
		39360	    IF NOT q_echoenabled THEN
B188		39390	    BEGIN WHILE trmop(8R0001,sysout,1) = 1 !=type ahead; DO getch;
		39420	      IF verybadscreen THEN
B189		39450	      BEGIN restore_screen(q_verticalpos, 998);
		39480	        verybadscreen:= badscreen:= FALSE;
E189		39510	      END ELSE echon;
E188		39540	    END;
		39570	    getout: nooutput:= FALSE; !z_t(-19);
		39600	    IF NOT command_done THEN
		39630	    warning(" The VIDED command was never EXECUTED!",NOTEXT);
		39660	    autobackcount:= autobackcount+1;
		39690	    IF autobackcount > autobackup THEN dobackup;
E88		39720	  END of getcommand;
		39721
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   26
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		39750	  PROCEDURE edit;
		39780	  COMMENT This procedures contains a loop with one step for every
		39810	  character typed by the user which is to be included in the text
		39840	  being edited. (Not characters in the inputting of VIDED commands
		39870	  preceded by ESCAPE or CONTROL-F). The procedure checks if the
		39900	  character is a single character command like CONTROL-U and
		39930	  performs the appropriate action;
B190		39960	  BEGIN INTEGER vpos, hpos; COMMENT pos before last character read;
		39990	    IF terminaltype = elite3025 THEN ! inverse video;
B191		40020	    BEGIN outchr(sysout,altmode,1); outchr(sysout,'O',1);
		40050	      outchr(sysout,char(16r31),1);
E191		40080	    END;
		40110	    WHILE TRUE DO
B192		40140	    BEGIN
		40170	      vpos:= q_verticalpos; hpos:= q_horizontalpos;
		40200	      COMMENT read one character;
		40230	      COMMENT%IFNOT CALLMAC
		40260	      call(p_insingle);
		40290	      COMMENT%IF CALLMAC;
		40320	      vtisng(cpunumber);
		40350	      COMMENT%IFEND CALLMAC;
		40380	      IF NOT q_echoenabled THEN
B193		40410	      BEGIN COMMENT shall we restore echoing if no type ahead?;
		40440	        IF NOT trmop(8R0001,sysout,1) = 1 !=type ahead; THEN echon;
E193		40470	      END;
		40500	      COMMENT%IF VIDTIM
		40530	      outchr(vidtim,q_gotchar,1);
		40560	      COMMENT%IFEND VIDTIM;
		40590	      COMMENT%IF debugslow
		40620	      IF debugslow > 0 THEN sleep(debugslow);
		40650	      COMMENT%IFEND debugslow;
		40680	      IF controlchar THEN
B194		40710	      BEGIN COMMENT character < 32 or > 126 or preceded by ESCAPE;
		40740	        IF q_gotchar EQ carriagereturn THEN
B195		40770	        BEGIN
		40800	          IF hpos > 0 THEN
		40830	          autobackcount:= autobackcount+1;
E195		40860	        END ELSE
B196		40890	        BEGIN
		40920	          IF q_gotchar = linefeed THEN
B197		40950	          BEGIN
		40980	            IF vpos >= heightm1 THEN
B198		41010	            BEGIN
		41040	              emptyscroll:= TRUE; call(p_scroll);
		41070	              emptyscroll:= FALSE;
E198		41100	            END;
		41130	            IF autobackcount > autobackup THEN dobackup;
E197		41160	          END ELSE
B199		41190	          BEGIN
		41220	            IF q_gotchar = altmode THEN
B200		41250	            BEGIN
		41280	              IF terminaltype = minitec OR terminaltype = tandberg
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  26-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		41310	              THEN outchr(terminalout,delayer,2);
		41340	              getcommand(NOTEXT);
E200		41370	            END ELSE IF q_gotchar = control_f
		41400	            OR q_gotchar = comstartchar THEN getcommand(NOTEXT)
		41430	            ELSE IF q_gotchar = tab THEN position_tab(TRUE)
		41460	            ELSE IF q_gotchar = fill THEN
B201		41490	            BEGIN COMMENT RUB OUT;
		41520	              IF hpos = 0 AND vpos > 0 THEN
B202		41550	              BEGIN COMMENT RUB OUT at beginning of line goes back
		41580	                to end of previous line;
		41610	                vpos:= vpos-1;
		41640	                hpos:= screen(vpos).strip.length;
		41670	                IF hpos > widthm1 THEN hpos:= widthm1;
		41700	                move_the_cursor_to(hpos,vpos);
E202		41730	              END;
E201		41760	            END ELSE IF q_gotchar = control_u THEN
B203		41790	            BEGIN IF q_gotchar NE right THEN blank_front;
E203		41820	            END ELSE IF q_gotchar = control_d THEN
		41850	            removechars(1) ELSE IF q_gotchar = control_v THEN
B204		41880	            BEGIN insert(line_model.sub(1,1),FALSE);
		41910	              move_the_cursor_to(hpos,vpos);
E204		41940	            END ELSE IF q_gotchar = control_w THEN
B205		41970	            BEGIN IF terminaltype = infoton THEN
		42000	              removeword;
E205		42030	            END ELSE
		42060	            IF insline NE null AND q_gotchar = insline THEN
		42090	            addline ELSE
		42120	            IF delline NE null AND q_gotchar = delline THEN
		42150	            removeline ELSE
		42180	            IF inschar NE null AND q_gotchar = inschar THEN
		42210	            charinsert ELSE
		42240	            IF delchar NE null AND q_gotchar = delchar THEN
		42270	            removechar ELSE
		42300	            IF unknownchar THEN
B206		42330	            BEGIN IF terminaltype = vt52 AND q_gotchar = char(6) THEN
		42360	              getcommand(NOTEXT) ELSE
B207		42390	              IF letter(q_gotchar) THEN BEGIN
B208		42420	                IF terminaltype = volker414h THEN BEGIN
		42450	                  IF q_gotchar = 'B' THEN getcommand("I")  ELSE
		42480	                  IF q_gotchar = 'C' THEN getcommand("X")  ELSE
		42510	                  IF q_gotchar = 'D' THEN getcommand("-X") ELSE
		42540	                  IF q_gotchar = 'E' THEN getcommand("S")  ELSE
		42570	                  IF q_gotchar = 'F' THEN getcommand("N")  ELSE
		42600	                  IF q_gotchar = 'G' THEN getcommand("K")  ELSE
		42630	                  IF q_gotchar = 'H' THEN getcommand("1L");
B209	E208	42660	                END ELSE IF terminaltype = elite3025 THEN BEGIN
		42690	                  IF q_gotchar = 'q' THEN getcommand("I")  ELSE
		42720	                  IF q_gotchar = 'r' THEN getcommand("X")  ELSE
		42750	                  IF q_gotchar = 's' THEN getcommand("-X") ELSE
		42780	                  IF q_gotchar = 't' THEN getcommand("S")  ELSE
		42810	                  IF q_gotchar = 'u' THEN getcommand("N")  ELSE
		42840	                  IF q_gotchar = 'v' THEN getcommand("K")  ELSE
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  26-2
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		42870	                  IF q_gotchar = 'w' THEN getcommand("1L") ELSE
		42900	                  GOTO restore;
E209		42930	                END ELSE GOTO restore;
E207		42960	              END ELSE restore: restore_screen(q_verticalpos, 998);
E206		42990	            END;
E199		43020	          END;
E196		43050	        END;
E194		43080	      END ELSE
B210		43110	      BEGIN COMMENT NOT controlchar;
		43140	        IF badscreen THEN COMMENT LF at bottom of a page;
B211		43170	        BEGIN echoff; emptyscroll:= TRUE; call(p_scroll);
		43200	          emptyscroll:= badscreen:= FALSE;
		43230	          restore_screen(q_verticalpos,998);
E211		43260	        END ELSE
		43290	        IF hpos >= widthm1 THEN
B212		43320	        BEGIN echoff; hpos:= q_horizontalpos; vpos:= q_verticalpos;
		43350	          restore_lines(IF vpos > 0 THEN vpos-1 ELSE vpos,vpos);
		43380	          move_the_cursor_to(hpos,vpos);
E212		43410	        END;
E210		43440	      END;
E192		43470	    END;
E190		43500	  END;
		43501
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   27
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		43530	  PROCEDURE stop_editing;
B213		43560	  BEGIN GOTO stopedit;
E213		43590	  END;
		43620	
		43650	  PROCEDURE closefiles;
		43680	  INSPECT sysout DO
B214		43710	  BEGIN COMMENT close edit text files;
		43740	    IF NOT backuping THEN
B215		43770	    BEGIN
		43800	      outtext(" INPUT FILE """);
		43830	      outtext(arg[3]); outchar('"'); outimage;
		43860	      outtext(" OUTPUT FILE """);
		43890	      outtext(arg[(IF tmpoutfile THEN 3 ELSE 1)]); outchar('"');
		43920	      outimage;
E215		43950	    END;
		43980	    IF NOT tmpoutfile THEN
B216		44010	    BEGIN editin.close; editout.close;
E216		44040	    END ELSE
B217		44070	    BEGIN COMMENT delete old backup file, rename input file to
		44100	      backup extension, rename output file to the name of the input
		44130	      file;
		44160	      TEXT bakfilename; CHARACTER c; INTEGER i;
		44190	      bakfilename:- copy(inspec);
		44220	      COMMENT backup file takes extension beginning with .Q;
		44250	      FOR i:= 0 STEP 1 UNTIL IF merryentry THEN 1 ELSE 0 DO

SIM307  W LINE 44250     EXPRESSION OR CONVERSION AFTER UNTIL 

B218		44280	      BEGIN
		44310	        bakfilename.setpos(1); scanto(bakfilename,'.');
		44340	        bakfilename.setpos(bakfilename.pos+i);
		44370	        c:= fetchar(bakfilename,bakfilename.pos);
		44400	        IF c NE '[' AND c NE '<' THEN
		44430	        bakfilename.putchar('Q') ELSE
		44460	        bakfilename:- conc(front(bakfilename),"Q",rest(bakfilename));
E218		44490	      END;
		44520	      depchar(bakfilename,bakfilename.length-3,'0');
		44550	
		44580	      outimage;
		44610	      IF rename(bakfilename,NOTEXT,FALSE) > 0 THEN
B219		44640	      BEGIN COMMENT Old backup file could not be deleted;
		44670	        outtext("?VIDED - CANNOT DELETE FILE: ");
		44700	        outtext(bakfilename);
		44730	        outimage; merrygoround:= FALSE;
		44760	        editin.close; editout.close;
E219		44790	      END ELSE
B220		44820	      BEGIN
		44850	        IF NOT backuping THEN
B221		44880	        BEGIN
		44910	          outtext(" INPUT FILE WILL BE RENAMED TO: ");
		44940	          outtext(bakfilename); outimage;
E221		44970	        END;
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  27-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		45000	        IF rename(editin,bakfilename,TRUE) >= 0 THEN
B222		45030	        BEGIN COMMENT input file could not be renamed to backup
		45060	          name;
		45090	          outtext("?VIDED - CANNOT RENAME INPUT FILE: ");
		45120	          outtext(inspec); editout.close; merrygoround:= FALSE;
E222		45150	        END ELSE
B223		45180	        BEGIN
		45210	          IF rename(editout,inspec,TRUE) >= 0 THEN
B224		45240	          BEGIN COMMENT temporary output file could not be renamed
		45270	            to the name of the input file;
		45300	            outtext("?VIDED - CANNOT RENAME OUTPUT FILE: ");
		45330	            outtext(arg[1]); merrygoround:= FALSE;
E224		45360	          END;
E223		45390	        END;
E220		45420	      END;
		45450	      sysout.outimage;
E217		45480	    END;
E214		45510	  END;
		45511
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   28
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		45540	  COMMENT start of execution;
		45570	
		45600	  IF terminaltype = volker414h THEN ! check EOM charcter;
B225		45614	  BEGIN echoff; outchr(sysout,altmode,1);
		45660	    outchr(sysout,'-',1); forceout(sysout);
		45674	    volkeomchar:= getch;
		45720	    IF volkeomchar = ' ' THEN volkeomchar:= getch ! control-D;
		45750	    ELSE
		45810	    IF volkeomchar = carriagereturn THEN getch ! read line feed;
		45825	    ELSE volkeomchar:= char(0);
		45840	    echon;
E225		45870	  END;
		45900	
		45930	  dashblank:- copy("- ");
		45960	  IF arg[18] =/= NOTEXT THEN direct_cursor_addressing:= TRUE;
		45990	  IF arg[19] =/= NOTEXT THEN direct_cursor_addressing:= FALSE;
		46020	  IF arg[20] =/= NOTEXT THEN allow_cr:= FALSE;
		46050	  IF arg[21] =/= NOTEXT THEN allow_cr:= TRUE;
		46080	
		46110	  COMMENT write TMPCOR TMP:TRM file with terminal info;
		46140	  tmpout("TRM",conc(arg[2],copy(IF direct_cursor_addressing
		46170	  THEN "/DCA" ELSE "/-DCA")));
		46200	
		46230	  mainloop: IF arg[23] =/= NOTEXT THEN swedish:= TRUE;
		46260	
		46290	  IF NOT merrygoround THEN
B226		46320	  BEGIN
		46350	    IF pageheader THEN
B227		46380	    BEGIN
		46410	      sid_word:- IF arg[25] =/= NOTEXT
		46440	      THEN storbokstav(conc(arg[25]," "))
		46470	      ELSE copy("SID "); page_word:- copy("PAGE ");
		46500	      header:- blanks(IF increment > 0 THEN width-8 ELSE width);
		46530	      header.setpos((header.length-sid_word.length-3)//2);
		46560	      puttext(header, IF swedish
		46590	      OR arg[25] =/= NOTEXT THEN sid_word ELSE page_word);
		46620	      puttext(header,"00");
		46650	      defaultheader:- copy(header.strip);
E227		46680	    END;
		46710	    restorechar:= erasescreen;
		46740	    line_model:- blanks(width);
		46770	    set_tty_tab;
		46800	    settab(0,'R'); ! Initial default tab settings;
E226		46830	  END of NOT merrygoround;
		46860	  margset('L',leftmargin);
		46890	  editout_image:- editout.image;
		46920	  printing:= TRUE;
		46950	  first_text_pos:= IF increment = 0 THEN 0 ELSE 8;
		46980	  scrollallow:= TRUE; first_input_line:= TRUE;
		47010	  out_pagenumber:= 1;
		47040	  initialload; pagenumber:= 1; ! Load first page;
		47070	  IF pageheader THEN adjust_date(screen[0]);
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  28-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		47100	  IF merrygoround THEN
B228		47130	  BEGIN newpages(startpage,pagebottom,FALSE);
		47160	    IF backuping THEN
B229		47190	    BEGIN
		47220	      printing:= FALSE; q_verticalpos:= heightm1;
		47250	      WHILE top_fill < backupzscroll OR sub_page_number <
		47280	      backupsubpage DO call(p_scroll);
		47310	      printing:= TRUE; normaltext;
		47340	      IF badscreen OR checksum NE backupchecksum
		47370	      THEN restore_screen(0,998) ELSE
B230		47400	      BEGIN screen_length[0]:= 45;
		47430	        restore_lines(0,0);
E230		47460	      END;
		47490	      move_the_cursor_to(backuphor,backupvert);
		47520	      backuping:= FALSE;
E229		47550	    END of backuping;
E228		47580	  END ELSE restore_screen(0,showdefault); ! show first page to user;
		47610	  merrygoround:= FALSE;
		47640	  IF trmop(8R0001,sysout,1) = 1 ! type ahead; THEN
		47670	  echoff ELSE echon;
		47700	  edit; COMMENT start of editing;
		47730	  stopedit:
		47760	  IF NOT q_echoenabled THEN echon;
		47790	  IF merrygoround THEN roundabout:
B231		47820	  BEGIN merrygoround:= TRUE; echoff;
E231		47850	  END ELSE
B232		47880	  BEGIN
		47910	    backuping:= merrygoround:= FALSE;
		47940	    q_display_output:= TRUE;
E232		47970	  END;
		48000	
		48030	  INSPECT sysout DO
B233		48060	  BEGIN
		48090	    IF backuping THEN
B234		48120	    BEGIN home_the_cursor;
		48150	      specialtext;
		48180	      IF startblink NE char(0) THEN
B235		48210	      BEGIN IF addaltmode THEN outchar(altmode);
		48240	        outchar(startblink);
E235		48270	      END;
E234		48300	    END ELSE blankterminal;
		48330	    outtext(IF merrygoround THEN
		48360	    "***** FILE BACK-UP IN PROGRESS. *****    "
		48390	    ELSE "VIDED IS FINISHING.");
		48420	    IF backuping AND startblink NE char(0) THEN
B236		48450	    BEGIN IF addaltmode THEN outchar(altmode);
		48480	      outchar(stopblink);
		48510	      breakoutimage;
E236		48540	    END ELSE breakoutimage;
E233		48570	  END of inspect sysout;
		48600	  finalwrite;
		48630	  closefiles;
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  28-2
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		48660	  IF NOT merrygoround THEN restore_trmops;
		48690	  detach;
		48720	  GOTO mainloop;
E71		48750	END of class vided3x;
		48751
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   29
DSK:MIDED3.SIM	   7-APR-1979   8:36	

		48780	topstart: COMMENT start of execution is here!!!!;
		48810	before_editing;
		48840	
		48870	IF the_editor == NONE THEN
		48900	the_editor:- NEW vided3x(
		48930	width, height,
		48960	COMMENT%IF debugterminal
		48990	newsysin, newsysout, NOT debug,
		49020	COMMENT%IFNOT debugterminal;
		49050	sysin, sysout, TRUE,
		49080	COMMENT%IFEND debugterminal;
		49110	terminaltype,giventrmspeed)
		49140	ELSE call(the_editor);
		49170	
		49200	stopedit:
		49230	COMMENT remember initial parameter settings at continued execution;
B237		49260	BEGIN INTEGER i;
		49290	  IF NOT merrygoround THEN
B238		49320	  BEGIN
		49350	    IF arg[24] =/= NOTEXT THEN run(arg[24],1);
		49380	    COMMENT%IF stat
		49410	    stat.close;
		49440	    COMMENT%IF stat
		49470	    stat:- NONE;
		49500	    COMMENT%IFEND stat;
		49530	    exit(0);
		49560	    FOR i:= 1 STEP 1 UNTIL keys DO
B239		49590	    BEGIN
		49620	      IF arg[i] =/= NOTEXT THEN
B240		49650	      BEGIN ini[i]:- arg[i]; arg[i]:- NOTEXT;
		49680	        ini[i].setpos(1);
E240		49710	      END;
E239		49740	    END;
E238		49770	  END;
		49800	  IF merrygoround THEN
B241		49830	  BEGIN IF tmpoutfile THEN arg[1]:- arg[3];
		49860	    arg[3]:- NOTEXT;
E241		49890	  END ELSE
B242		49920	  BEGIN
		49950	    ini[1]:- ini[3]:- NOTEXT;
		49980	    tmpoutfile:= FALSE;
		50010	    COMMENT%IF VIDTIM
		50040	    vidtim.close;
		50070	    COMMENT%IFEND VIDTIM;
		50100	    COMMENT%IF FQC
		50130	    Goto totalstop;
		50160	    COMMENT%IFEND FQC;
E242		50190	  END;
		50220	  GOTO topstart;
E237		50250	END;
		50280	totalstop:
E1		50310	END;

DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  29-1
DSK:MIDED3.SIM	   7-APR-1979   8:36	



SWITCHES CHANGED FROM DEFAULT:

  -A NO CHECK OF ARRAY INDEX
  -D NO SYMBOL TABLE GENERATED FOR DEBUG
   E EXTERNAL CLASS/PROCEDURE
  -Q NO CHECK OF QUALIFICATION

ERRORS DETECTED:
    3 TYPE W MESSAGES
DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE   30
DSK:MIDED3.SIM	   7-APR-1979   8:36		LINE NUMBER TABLE

 1620	001153	 5730	001614	 7980	002444	10380	003366	12930	004345
 3060	001154	 5760	001625	 8040	002450	10410	003374	12960	004356
 3150	001220	 5790	001636	 8070	002454	10440	003405	12990	004413
 3180	001220	 5820	001647	 8130	002467	10470	003412	13080	004424
 3240	001223	 5850	001660	 8160	002501	10500	003417	13140	004442
 3270	001227	 5880	001671	 8190	002511	10530	003430	13230	004446
 3300	001234	 5910	001702	 8220	002514	10560	003443	13290	004453
 3330	001246	 5940	001713	 8310	002532	10590	003463	13350	004465
 3330	001253	 5970	001724	 8340	002555	10620	003472	13380	004476
 3360	001264	 6000	001735	 8400	002561	10650	003473	13410	004505
 3390	001265	 6030	001746	 8430	002570	10710	003513	13440	004515
 3570	001265	 6060	001757	 8520	002573	10770	003514	13470	004520
 3600	001300	 6090	001770	 8580	002575	10890	003533	13500	004533
 3630	001312	 6120	002001	 8610	002576	10920	003536	13530	004555
 3660	001322	 6150	002012	 8640	002600	10950	003557	13560	004563
 3720	001326	 6180	002023	 8700	002606	10980	003561	13590	004603
 3750	001335	 6210	002034	 8730	002621	11040	003571	13620	004613
 3870	001341	 6240	002045	 8820	002657	11070	003600	13680	004632
 3930	001343	 6330	002050	 8880	002712	11100	003634	13710	004646
 3960	001354	 6390	002070	 8910	002716	11130	003657	13740	004650
 4020	001360	 6420	002073	 8940	002727	11190	003674	13800	004675
 4080	001362	 6450	002100	 9000	002736	11220	003706	13860	004707
 4110	001365	 6480	002101	 9030	002742	11280	003720	13890	004723
 4140	001366	 6510	002102	 9120	002743	11310	003727	13950	004727
 4170	001371	 6570	002106	 9210	002750	11370	003731	13980	004735
 4200	001375	 6630	002112	 9240	002774	11400	003742	14040	004742
 4230	001400	 6660	002122	 9270	003013	11430	003747	14070	004777
 4260	001404	 6720	002136	 9300	003025	11490	003772	14100	005012
 4290	001411	 6750	002144	 9330	003037	11520	003776	14130	005015
 4380	001423	 6810	002166	 9360	003061	11550	004006	14160	005020
 4410	001425	 6930	002167	 9390	003062	11670	004007	14190	005027
 4440	001426	 6990	002172	 9450	003064	11700	004016	14220	005051
 4470	001430	 7020	002176	 9480	003102	11730	004031	14250	005057
 4500	001432	 7080	002230	 9540	003105	11760	004035	14280	005063
 4530	001436	 7110	002234	 9570	003127	11790	004045	14310	005067
 4560	001442	 7140	002244	 9630	003130	11820	004051	14340	005067
 4590	001443	 7170	002250	 9660	003143	11940	004056	14460	005071
 4650	001443	 7200	002253	 9720	003144	11970	004062	14490	005126
 5070	001446	 7230	002254	 9750	003165	12030	004076	14520	005141
 5130	001450	 7410	002267	 9780	003222	12150	004115	14580	005144
 5280	001454	 7440	002302	 9810	003226	12240	004135	14610	005150
 5370	001457	 7470	002314	 9840	003243	12390	004154	14640	005153
 5430	001463	 7500	002326	 9930	003247	12450	004177	14670	005175
 5460	001473	 7560	002346	 9990	003263	12480	004211	14700	005203
 5490	001504	 7620	002351	10020	003303	12510	004217	14730	005212
 5520	001515	 7680	002353	10050	003311	12540	004222	14850	005216
 5550	001526	 7710	002365	10080	003323	12570	004237	14910	005222
 5580	001537	 7830	002367	10110	003331	12600	004244	14970	005256
 5610	001550	 7860	002374	10140	003340	12780	004245	15570	005273
 5640	001561	 7890	002417	10170	003351	12840	004251	15600	005277
 5670	001572	 7920	002423	10230	003362	12870	004305	15630	005303
 5700	001603	 7950	002425	10290	003364	12900	004310	15750	005310

DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  30-1
DSK:MIDED3.SIM	   7-APR-1979   8:36		LINE NUMBER TABLE

15810	005313	19170	006522	21270	007210	23190	007656	26460	010366
15840	005316	19200	006524	21300	007212	24030	007657	26520	010372
15870	005323	19260	006551	21330	007215	24060	007662	26550	010377
15930	005330	19290	006555	21360	007222	24090	007675	26580	010407
15990	005342	19320	006556	21390	007232	24120	007704	26700	010410
16020	005354	19410	006556	21420	007237	24180	007705	26760	010414
16080	005364	19470	006562	21450	007252	24240	007705	26970	010417
16110	005376	19500	006565	21480	007263	24270	007711	27030	010433
16140	005411	19650	006600	21510	007276	24300	007715	27090	010452
16170	005415	19710	006612	21540	007301	24330	007716	27120	010455
16200	005432	19740	006623	21570	007303	24360	007720	27150	010460
16230	005440	19800	006624	21630	007306	24390	007725	27210	010471
16290	005444	19830	006634	21660	007311	24420	007742	27270	010476
16350	005455	19860	006653	21720	007326	24480	007754	27300	010500
16440	005470	19890	006665	21750	007331	24540	007765	27360	010504
16560	005512	19920	006676	21810	007346	24600	007777	27390	010517
16590	005523	19980	006713	21840	007351	24630	010007	27420	010530
16620	005532	20040	006713	21870	007356	24660	010011	27450	010532
16650	005555	20070	006717	21930	007376	24780	010044	27480	010540
16680	005562	20100	006740	21960	007401	24810	010046	27510	010546
16710	005566	20130	006746	21990	007403	24840	010063	27540	010547
16770	005577	20160	006752	22020	007413	24870	010067	27570	010550
16800	005611	20190	006762	22050	007423	24900	010102	27630	010557
16830	005621	20220	006772	22080	007425	24960	010111	27660	010560
16860	005644	20250	007003	22110	007431	25050	010141	27674	010564
16920	005656	20280	007010	22140	007436	25080	010144	27680	010572
16955	005671	20310	007023	22170	007440	25110	010144	27682	010574
16960	005673	20340	007024	22230	007441	25140	010151	27686	010625
16965	005705	20400	007030	22260	007446	25170	010154	27688	010635
16970	005717	20430	007036	22290	007451	25200	010156	27691	010641
17220	005722	20460	007037	22320	007453	25260	010161	27720	010645
17280	005727	20520	007037	22350	007457	25320	010162	27780	010646
17310	005741	20520	007044	22410	007463	25440	010162	27840	010651
17340	005753	20550	007051	22440	007470	25560	010172	27900	010661
17430	005767	20640	007053	22470	007502	25595	010173	27960	010676
17464	006035	20670	007055	22500	007511	25600	010203	28050	010724
17466	006046	20700	007062	22530	007515	25603	010217	28080	010727
17468	006055	20730	007072	22560	007516	25605	010235	28140	010733
17480	006061	20760	007102	22650	007521	25800	010250	28200	010734
17490	006074	20790	007105	22680	007526	25830	010252	28230	010737
17550	006107	20820	007111	22710	007541	25860	010260	28260	010743
18420	006450	20880	007121	22800	007556	25890	010270	28320	010750
18480	006452	20910	007123	22830	007572	25920	010306	28350	010756
18510	006460	20940	007126	22860	007606	26100	010316	28440	010764
18570	006472	20970	007137	22890	007607	26130	010317	28470	010765
18630	006474	21000	007151	22920	007613	26190	010317	28530	010765
18690	006503	21030	007153	22950	007617	26250	010322	28560	010771
18720	006507	21060	007163	23010	007622	26280	010326	28620	010774
18750	006516	21090	007166	23070	007630	26310	010341	28710	011022
18870	006520	21150	007171	23100	007641	26340	010345	28740	011035
18900	006521	21180	007174	23130	007643	26370	010345	28770	011056
18930	006521	21210	007204	23160	007656	26400	010354	28800	011060

DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  30-2
DSK:MIDED3.SIM	   7-APR-1979   8:36		LINE NUMBER TABLE

28860	011074	30960	011633	32880	012453	34890	013233	37290	014211
28890	011115	30990	011637	32940	012471	34920	013234	37320	014216
28920	011117	31020	011643	33060	012531	34950	013252	37350	014226
29010	011124	31050	011647	33210	012534	35010	013267	37380	014232
29040	011137	31080	011653	33270	012540	35040	013272	37470	014253
29070	011140	31110	011664	33330	012543	35070	013277	37500	014257
29100	011140	31140	011674	33390	012557	35131	013337	37530	014260
29130	011145	31170	011676	33420	012563	35190	013354	37569	014275
29160	011155	31200	011711	33450	012564	35250	013372	37576	014311
29250	011156	31230	011715	33480	012577	35340	013422	37590	014322
29280	011163	31260	011726	33570	012600	35400	013423	37650	014330
29310	011167	31290	011732	33600	012607	35460	013427	37680	014333
29340	011200	31320	011741	33630	012611	35490	013433	37830	014334
29370	011204	31350	011745	33660	012613	35550	013434	37860	014352
29430	011223	31410	011754	33690	012624	35610	013453	37890	014353
29460	011227	31440	011763	33720	012634	35700	013466	37920	014357
29490	011245	31470	011767	33750	012653	35760	013510	38010	014407
29520	011251	31500	012000	33780	012673	35790	013514	38070	014412
29580	011275	31530	012010	33810	012674	35820	013520	38130	014427
29640	011304	31560	012024	33840	012700	35850	013524	38160	014431
29700	011327	31590	012025	33870	012703	35880	013525	38190	014442
29730	011333	31620	012034	33900	012712	35910	013537	38220	014452
29760	011344	31650	012040	33930	012716	36060	013564	38250	014473
29790	011346	31680	012045	33960	012725	36120	013570	38280	014506
29820	011361	31710	012060	33990	012731	36150	013573	38340	014522
29850	011365	31770	012072	34020	012742	36180	013614	38400	014537
29880	011371	31800	012100	34050	012752	36270	013652	38460	014551
29910	011373	31830	012136	34080	012757	36300	013670	38520	014562
29940	011376	31860	012137	34110	012767	36330	013671	38580	014567
30000	011401	31890	012141	34140	012773	36360	013702	38610	014571
30060	011416	31920	012152	34170	013002	36390	013712	38640	014602
30150	011423	31980	012161	34200	013006	36450	013715	38670	014614
30180	011426	32010	012165	34230	013017	36480	013717	38700	014617
30210	011435	32040	012170	34260	013027	36510	013726	38790	014632
30270	011440	32070	012172	34290	013043	36540	013735	38820	014633
30300	011443	32100	012205	34320	013051	36600	013760	38880	014634
30330	011447	32160	012206	34350	013057	36630	013771	38940	014637
30390	011450	32190	012214	34380	013067	36690	013775	38970	014642
30420	011453	32220	012223	34410	013073	36720	014005	39030	014645
30450	011455	32280	012263	34440	013077	36750	014023	39150	014674
30510	011471	32340	012264	34470	013103	36780	014037	39360	014675
30540	011473	32370	012266	34500	013106	36840	014050	39390	014700
30570	011477	32400	012277	34530	013112	36900	014054	39420	014717
30630	011510	32430	012307	34560	013116	36930	014075	39450	014722
30660	011524	32490	012330	34590	013120	36990	014107	39480	014732
30690	011530	32550	012356	34650	013122	37080	014131	39510	014735
30720	011545	32640	012413	34680	013124	37110	014135	39510	014736
30750	011551	32730	012414	34710	013140	37140	014145	39570	014740
30780	011553	32760	012420	34740	013165	37170	014150	39600	014742
30840	011571	32790	012423	34770	013166	37200	014152	39660	014757
30900	011614	32820	012430	34830	013202	37230	014174	39690	014761
30930	011622	32850	012437	34861	013231	37260	014201	39720	014766

DECsystem-20 SIMULA  %4A(310)               25-JAN-1981  18:37				 PAGE  30-3
DSK:MIDED3.SIM	   7-APR-1979   8:36		LINE NUMBER TABLE

39750	014767	42480	015505	44490	016275	46890	017114	48780	017465
39990	014767	42510	015521	44520	016276	46920	017120	48780	017467
40020	014773	42540	015535	44580	016305	46950	017121	48870	017471
40050	015006	42570	015551	44610	016307	46980	017130	49140	017521
40170	015013	42600	015565	44670	016330	47010	017132	49200	017523
40320	015020	42630	015601	44700	016333	47040	017134	49290	017525
40380	015024	42660	015614	44730	016337	47070	017140	49350	017527
40440	015027	42690	015621	44760	016343	47100	017154	49530	017554
40680	015045	42720	015634	44790	016350	47130	017157	49560	017556
40740	015050	42750	015650	44850	016351	47160	017171	49620	017571
40800	015053	42780	015664	44910	016354	47220	017174	49650	017602
40860	015060	42810	015700	44940	016357	47250	017177	49680	017622
40920	015061	42840	015714	45000	016365	47280	017213	49740	017631
40980	015065	42870	015730	45090	016407	47310	017216	49800	017632
41040	015070	42900	015744	45120	016412	47340	017221	49830	017634
41070	015073	42930	015745	45150	016423	47370	017244	49860	017650
41130	015075	42960	015747	45210	016424	47400	017245	49890	017656
41160	015103	43080	015760	45300	016446	47430	017252	49950	017657
41220	015104	43140	015761	45330	016451	47490	017261	49980	017672
41280	015110	43170	015764	45450	016463	47520	017271	50220	017673
41340	015130	43200	015772	45480	016466	47580	017273	50250	017674
41370	015137	43230	015775	45510	016470	47610	017304	50280	017676
41430	015163	43260	016005	45600	016475	47640	017306	50311	017701
41460	015175	43290	016006	45600	016477	47670	017324	    0	000000
41520	015202	43320	016012	45614	016502	47700	017327
41610	015215	43350	016021	45660	016511	47730	017331
41640	015216	43380	016036	45674	016521	47790	017335
41670	015227	43470	016045	45720	016525	47820	017340
41700	015235	43500	016046	45810	016535	47850	017344
41760	015244	43530	016047	45825	016543	47910	017345
41790	015251	43560	016047	45840	016547	47940	017350
41820	015256	43590	016053	45930	016551	48030	017351
41850	015270	43650	016054	45960	016555	48090	017356
41880	015275	43680	016054	45990	016567	48120	017361
41910	015311	43740	016061	46020	016601	48150	017363
41940	015320	43800	016064	46050	016613	48180	017365
41970	015325	43830	016067	46140	016625	48210	017371
42030	015332	43860	016104	46230	016673	48240	017376
42060	015333	43890	016107	46290	016705	48300	017401
42090	015351	43920	016126	46350	016710	48330	017404
42120	015352	43980	016130	46410	016712	48420	017414
42150	015370	44010	016133	46470	016757	48450	017426
42180	015371	44040	016140	46500	016763	48480	017433
42210	015407	44070	016141	46530	016776	48510	017436
42240	015410	44190	016143	46560	017007	48540	017440
42270	015426	44250	016151	46620	017045	48570	017443
42300	015427	44310	016171	46650	017057	48600	017447
42330	015432	44340	016203	46710	017065	48630	017451
42360	015455	44370	016211	46740	017067	48660	017453
42390	015456	44400	016221	46770	017073	48690	017460
42420	015467	44430	016237	46800	017075	48720	017461