home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / USCX / STEVEUT.ZIP / EDT-MAIN.PAS < prev    next >
Pascal/Delphi Source File  |  1984-05-23  |  25KB  |  642 lines

  1. {  $LIST+, $DEBUG+, $BRAVE+, $LINESIZE:132,$PAGESIZE:77, $OCODE+   }
  2. {  $MATHCK+, $RANGECK+, $INITCK+, $INDEXCK+, $ENTRY+    }
  3. {  $LINE+, $RUNTIME+, $SYMTAB+, $WARN+, $GOTO+     }
  4. {  $TITLE:'EDITOR .PAS -- AEM$SCRATCH'             }
  5. {  $MESSAGE:'PASCAL - COMPILATION OPTIONS SET'     }
  6. {  $MESSAGE:'SYSTEM - COMPILATION BEGINS'          }
  7.  
  8.  
  9. PROGRAM EDITOR_CODE (EDFILE,INPUT,OUTPUT);
  10.  
  11. {  file contains the primary functions of the editor,  EDIT-MOD contains
  12.    most of the code required for the command procedures and environment
  13.    modification coding.   This must be linked to that module at OBJ time
  14.    link time                                           }
  15.  
  16. const
  17.    charspernode    = 34;
  18.    debug   = true;
  19.    maxcharp1   = 201;
  20.    maxchars    = 200;
  21.    maxcommandlength    = 7;
  22.    numberlongcommands  =17;
  23.    numbershortcommands =18;
  24.    off = false;
  25.    on  = true;
  26.  
  27. type
  28.    linecharptr  =   ^linecharnode;
  29.    lineptr     =   ^lineptrnode;
  30.    lineptrnode =   record
  31.        length  :   0 .. maxchars;
  32.        nextline:   lineptr;
  33.        previousline    :   lineptr;
  34.        firstnode   : linecharptr
  35.    end;    {   record   }
  36.    linecharnode    =   record
  37.        nextnode    : linecharptr;
  38.        chars       : packed array [ 1 .. charspernode] of char
  39.    end;  { record  }
  40.    linelengthdef   = 0 .. maxchars;
  41.    linedef = record
  42.        length  : linelengthdef;
  43.        position : 0 .. maxcharp1;
  44.        chars   : array [ 1 .. maxcharp1] of char
  45.    end;   { record  }
  46.    messagetype = lstring (30);
  47.    commanddef  = record
  48.        length  : linelengthdef;
  49.        position: 0 .. maxcharp1;
  50.        chars   : packed array [ 1 .. maxcommandlength] of char
  51.    end;   { record  }
  52.    stringdef   = record
  53.        first   : 0 .. maxcharp1;
  54.        last    : linelengthdef;
  55.        length  : linelengthdef
  56.    end;
  57.    commandtable    = record
  58.        shortcommands : array [ 1 .. numbershortcommands ] of char;
  59.        longcommands  : array [ 1 .. numberlongcommands ] of
  60.                            packed array [ 1 .. maxcommandlength ] of char
  61.    end;   { record  }
  62.  
  63. var [public]
  64.    filename : lstring (14);
  65.    filestats: char;
  66.    command             :   commanddef;
  67.    commandline         :   linedef;
  68.    currentline,sentinel:   lineptr;
  69.    edfile              :   text;
  70.    isitacommand, legalcommand, noerror, running, verify : boolean;
  71.    ordinal : integer;
  72.    tablecommands : commandtable;
  73.  
  74.  
  75. procedure endxqq; external;  {  library function to terminate  }
  76. procedure cls; external;
  77. function min ( x, y : integer) : integer; external;
  78. procedure readline (var line : linedef);  external;
  79. procedure insertline (currentline, newline : lineptr); external;
  80. procedure packline (line : linedef; packedline : lineptr);    external;
  81. procedure readfile (var currentline, sentinel : lineptr);    external;
  82. procedure errormessage (var noerror : boolean; message : messagetype); external;
  83. procedure removetrailingblanks (var line : linedef);   external;
  84. procedure checkempty (sentinel : lineptr; var noerror : boolean);  external;
  85. procedure readcommand (prompt : char; var line : linedef);    external;
  86. procedure skipblanks (var line : linedef);   external;
  87. procedure movelinepointer (var currentline : lineptr; linestomove : integer;
  88.                            sentinel : lineptr; var noerror : boolean); external;
  89. function numeric ( ch : char) : boolean;  external;
  90. procedure getnumber (var line : linedef; var number : integer;
  91.                  var legalnumber : boolean);     external;
  92. procedure processprefix (var commandline : linedef; var currentline : lineptr;
  93.                      sentinel : lineptr; var noerror : boolean); external;
  94. function alphabetic (ch : char) : boolean;  external;
  95. procedure getcommand(var commandline : linedef; var command : commanddef;
  96.                      var legalcommand, noerror : boolean); external;
  97. procedure commandordinal (command : commanddef; var ordinal : integer;
  98.                       var tablecommands : commandtable; var noerror : boolean); external;
  99. procedure endparse (commandline : linedef; var noerror : boolean); external;
  100. procedure getstring (var commandline : linedef; var strng : stringdef;
  101.                      var legalstring : boolean); external;
  102. procedure unpackline(var line : linedef; pline : lineptr);  external;
  103. procedure stringin(var line : linedef; strng : stringdef;
  104.                    var commandline : linedef; var found : boolean);   external;
  105. procedure locate (strng : stringdef; var pline : lineptr;
  106.                    var count :integer; increment : integer; sentinel : lineptr;
  107.                    var commandline : linedef; var noerror : boolean);  external;
  108. procedure getparameter(var commandline : linedef; sentinel : lineptr;
  109.                        var count : integer; var noerror : boolean);  external;
  110. procedure printline(line : linedef); external;
  111. procedure printpackedline (pline : lineptr); external;
  112. procedure freetext (pline : lineptr);  external;
  113. procedure deleteline (pline : lineptr); external;
  114.  
  115.  
  116.  
  117. procedure readdataline (var line, commandline : linedef; var isitacommand : boolean);
  118. begin
  119.    readcommand ('*',line);
  120.    if (line.length >0 ) and (line.chars[1] = '\') then
  121.        begin
  122.            isitacommand := true;
  123.            line.position := 2;
  124.            commandline := line
  125.        end
  126. end;  { procedure  }
  127.  
  128. procedure abortt (commandline : linedef; var noerror : boolean; var running : boolean);
  129. begin
  130.    endparse (commandline,noerror);
  131.    if noerror then
  132.        begin
  133.            running := false;
  134.            errormessage(noerror, 'EDIT ABORTED.  FILE UNCHANGED')
  135.        end
  136. end;  { abort  }
  137.  
  138. procedure append (var commandline :  linedef; currentline : lineptr;
  139.                    sentinel : lineptr; verify : boolean; var noerror : boolean);
  140. var
  141.    charnum : linelengthdef;   truncated, column : integer;
  142.    legalnumber, legalstring : boolean;   scratchline : linedef;
  143.    strng:stringdef;
  144. begin
  145.    unpackline(scratchline,currentline);
  146.    getstring(commandline,strng,legalstring);
  147.    if legalstring then
  148.        begin
  149.            with commandline do
  150.                if position <= length then position := position + 1;
  151.            getnumber (commandline,column,legalnumber);
  152.            if not legalnumber then column := scratchline.length + 1
  153.        end
  154.    else errormessage (noerror,'STRING FIELD NOT SEEN');
  155.    endparse(commandline,noerror);
  156.    checkempty(sentinel,noerror);
  157.    if noerror and (column <= 0) or (column > maxchars) then
  158.            errormessage (noerror, 'COLUMN POSITION OUT OF RANGE');
  159.    if noerror and (strng.length > 0) then
  160.        begin
  161.            if (column + strng.length - 1 ) > maxchars then
  162.                begin
  163.                    truncated := column + strng.length -1 - maxchars;
  164.                    strng.last := strng.last-truncated;
  165.                    strng.length := strng.length - truncated;
  166.                    errormessage (noerror, 'LINE TRUNCATED -- TOO LONG');
  167.                    noerror := true
  168.                end;
  169.            if strng.length > 0 then
  170.                begin
  171.                    for charnum := 0 to scratchline.length -1 do
  172.                        scratchline.chars[column+charnum] := commandline.chars[strng.first+charnum];
  173.                    scratchline.length := column+strng.length-1;
  174.                    packline(scratchline,currentline)
  175.                end;
  176.            if verify then printline (scratchline)
  177.        end
  178. end;  { procedure }
  179. procedure bottom (var commandline : linedef; var currentline : lineptr;
  180.                    sentinel : lineptr; verify : boolean; var noerror : boolean);
  181. begin
  182.    endparse(commandline,noerror);
  183.    checkempty(sentinel,noerror);
  184.    if noerror then
  185.        begin
  186.            currentline := sentinel^.previousline;
  187.            if verify then printpackedline(currentline);
  188.            writeln ('*EOF')
  189.        end
  190. end;  { proc }
  191.  
  192. procedure change (var commandline : linedef; currentline, sentinel : lineptr;
  193.                    verify : boolean; var noerror : boolean);
  194. var
  195.    index :integer;  legal1string, legal2string,stringthere :boolean;
  196.    scratch1line,scratch2line : linedef;
  197.    string1,string2 : stringdef;
  198. begin
  199.    getstring (commandline,string1,legal1string);
  200.    getstring (commandline,string2,legal2string);
  201.    if legal1string and legal2string then
  202.        begin
  203.            commandline.position := commandline.position + 1;
  204.            endparse(commandline,noerror);
  205.            checkempty(sentinel,noerror);
  206.            if noerror then
  207.                begin
  208.                    unpackline(scratch1line,currentline);
  209.                    stringin(scratch1line,string1,commandline,stringthere);
  210.                    if stringthere then
  211.                      begin
  212.                        if scratch1line.position > 1 then
  213.                        begin
  214.                            for index := 1 to scratch1line.position -1 do
  215.                                scratch2line.chars[index]:=scratch1line.chars[index];
  216.                            scratch2line.position := scratch1line.position - 1
  217.                        end
  218.                    else scratch2line.position := 0;
  219.                    if string2.length > 0 then
  220.                      begin
  221.                        for index := string2.first to string2.last do
  222.                        begin
  223.                            scratch2line.position := scratch2line.position+1;
  224.                            scratch2line.chars[scratch2line.position] := commandline.chars[index]
  225.                        end
  226.                      end;
  227.                    scratch1line.position := scratch1line.position + string1.length;
  228.                    if scratch1line.position = 0 then scratch1line.position := 1;
  229.                    while scratch1line.position <= scratch1line.length do
  230.                        begin
  231.                            scratch2line.position := scratch2line.position+1;
  232.                            scratch2line.chars[scratch2line.position] := scratch1line.chars[scratch1line.position];
  233.                            scratch1line.position := scratch1line.position +1
  234.                        end;
  235.                    scratch2line.length := scratch2line.position;
  236.                    packline(scratch2line,currentline);
  237.                    if verify then printline(scratch2line);
  238.                    writeln ('*** CHANGED')
  239.                end
  240.            else errormessage (noerror, 'STRING NOT FOUND')
  241.          end
  242.        end
  243.    else errormessage (noerror,'INVALID PARAMETER')
  244. end;  { procedure change  }
  245.  
  246. procedure delete(var commandline:linedef; var currentline:lineptr;
  247.                    sentinel : lineptr; verify : boolean; var noerror : boolean);
  248. var
  249.    count, increment : integer;   pline : lineptr;
  250.    delcount : integer;
  251. begin
  252.    getparameter(commandline,sentinel,count,noerror);
  253.    endparse(commandline,noerror);
  254.    checkempty(sentinel,noerror);
  255.    delcount := abs (count);
  256.    if noerror then
  257.        begin
  258.            if count > 0 then increment := 1 else increment := -1;
  259.            while (count <> 0) and noerror do
  260.                begin
  261.                    pline := currentline;
  262.                    if verify then printpackedline(pline);
  263.                    movelinepointer(currentline,increment,sentinel,noerror);
  264.                    count:=count-increment;
  265.                    deleteline(pline)
  266.                end;
  267.            if not noerror then
  268.                if increment > 0 then currentline := sentinel^.previousline
  269.            else currentline := sentinel^.nextline
  270.        end;
  271.    writeln ('*** ', delcount : 1, '  LINES DELETED')
  272. end;
  273.  
  274. procedure equal (var commandline : linedef; var currentline : lineptr);
  275. var
  276.    index, newposition : linelengthdef;  pline : lineptr;
  277. begin
  278.    with commandline do
  279.        begin
  280.            if position <= length then
  281.                begin
  282.                    newposition := 0;
  283.                    for index := position to length do
  284.                        begin
  285.                            newposition := newposition + 1;
  286.                            chars[newposition]:=chars[index]
  287.                        end;
  288.                    length := newposition
  289.                end
  290.            else length := 0;
  291.            new (pline);
  292.            packline (commandline,pline);
  293.            insertline(currentline,pline);
  294.            currentline := pline
  295.        end; { with }
  296.    writeln ('*** LINE REPLACED')
  297. end;  { proc }
  298.  
  299. procedure find (var commandline : linedef; var currentline : lineptr;
  300.                sentinel : lineptr; verify : boolean; var noerror : boolean);
  301. var
  302.    count,increment :integer; legalstring:boolean;
  303.    pline:lineptr; strng:stringdef;
  304. begin
  305.    with commandline do
  306.        begin
  307.            if (chars[position]='-') and (position <= length) then
  308.                begin
  309.                    increment := -1;
  310.                    position := position + 1
  311.                end
  312.            else increment := 1
  313.    end;
  314.    getstring(commandline,strng,legalstring);
  315.    if legalstring then
  316.        begin
  317.            commandline.position := commandline.position+1;
  318.            endparse(commandline,noerror);
  319.            checkempty(sentinel,noerror);
  320.            if noerror then
  321.                begin
  322.                    pline := currentline;
  323.                    locate (strng,pline,count,increment,sentinel,commandline,noerror);
  324.                    if noerror then
  325.                        begin
  326.                            currentline := pline;
  327.                            if verify then printpackedline(currentline)
  328.                        end
  329.                end
  330.    end
  331.    else
  332.        errormessage (noerror,'INVALID PARAMETER')
  333. end; { find procedure }
  334.  
  335. procedure header (var commandline : linedef; var noerror : boolean);
  336. var
  337.    index, width : integer;  legalnumber : boolean;
  338. begin
  339.    getnumber(commandline,width,legalnumber);
  340.    if not legalnumber then
  341.          width := 72;
  342.    endparse(commandline,noerror);
  343.    if (width > 0) and noerror then
  344.        begin
  345.            write ('  |');   {  move out of prompt area  }
  346.            for index := 1 to width do
  347.                 write (index mod 10 : 1);
  348.            writeln  ('|')
  349.        end
  350. end;  { proc  }
  351.  
  352. procedure insert (var commandline:linedef;var currentline:lineptr;
  353.                    sentinel:lineptr;var isitacommand :boolean; var noerror : boolean);
  354. var
  355.    pline : lineptr; scratchline : linedef;
  356. begin
  357.    cls;
  358.    writeln ('MODE> ...INSERT');
  359.    endparse(commandline,noerror);
  360.    if noerror then
  361.        begin
  362.            while not isitacommand do
  363.                begin
  364.                    readdataline(scratchline,commandline,isitacommand);
  365.                    with scratchline do
  366.                     begin
  367.                        if not isitacommand then
  368.                        begin
  369.                            new(pline);
  370.                            packline(scratchline,pline);
  371.                            insertline(currentline,pline);
  372.                            currentline := currentline^.nextline
  373.                        end
  374.                      end
  375.            end
  376.        end;
  377.    writeln ('MODE> COMMAND')
  378. end;  {proc }
  379.  
  380. procedure next(var commandline:linedef;var currentline:lineptr;
  381.                sentinel:lineptr;verify:boolean;var noerror :boolean);
  382. var
  383.    count :integer;  legalnumber :boolean;
  384. begin
  385.    getnumber(commandline,count,legalnumber);
  386.    if not legalnumber then count := 1;
  387.    endparse(commandline,noerror);
  388.    checkempty(sentinel,noerror);
  389.    if noerror then
  390.        begin
  391.            movelinepointer(currentline,count,sentinel,noerror);
  392.            if verify then printpackedline(currentline)
  393.        end
  394. end;
  395.  
  396. procedure print(var commandline:linedef;var currentline:lineptr;
  397.                 sentinel:lineptr;verify :boolean;var noerror:boolean);
  398. var
  399.    count,increment:integer;
  400. begin
  401.    getparameter(commandline,sentinel,count,noerror);
  402.    endparse(commandline,noerror);
  403.    checkempty(sentinel,noerror);
  404.    if noerror then
  405.        begin
  406.            if count < 0 then increment := -1 else increment := 1;
  407.            printpackedline(currentline);
  408.            count:=count-increment;
  409.            while (count <> 0) and noerror do
  410.                begin
  411.                    movelinepointer(currentline,increment,sentinel,noerror);
  412.                    count:=count-increment;
  413.                    if noerror then printpackedline(currentline)
  414.                end
  415.    end
  416. end;  { proc  }
  417.  
  418. procedure replace(var commandline:linedef;var currentline:lineptr;
  419.                    sentinel:lineptr;var isitacommand:boolean;var noerror:boolean);
  420. var
  421.    firstline:boolean; scratchline:linedef;
  422. begin
  423.    writeln ('MODE> ...REPLACE');
  424.    endparse(commandline,noerror);
  425.    checkempty(sentinel,noerror);
  426.    firstline:=true;
  427.    while (not isitacommand) and noerror do
  428.        begin
  429.            readdataline(scratchline,commandline,isitacommand);
  430.            if not isitacommand then
  431.                begin
  432.                    if firstline then firstline := false
  433.                    else movelinepointer(currentline,1,sentinel,noerror);
  434.                    freetext(currentline);
  435.                    packline(scratchline,currentline);
  436.                    if currentline=sentinel^.previousline then
  437.                    errormessage (noerror,'END OF INPUT FILE')
  438.                end
  439.        end;
  440.    writeln ('MODE> COMMAND')
  441. end;  { proc  }
  442.  
  443. procedure stop (var commandline:linedef;sentinel:lineptr;
  444.                var running,noerror : boolean);
  445. var
  446.    currentline:lineptr;  index:integer;  scratchline:linedef;
  447.    linecount : integer;
  448. begin
  449.    endparse(commandline,noerror);
  450.    if noerror then
  451.        begin
  452.            cls;
  453.            linecount := 0;
  454.            rewrite(edfile);
  455.            currentline := sentinel;
  456.            checkempty(sentinel,noerror);
  457.            if noerror then
  458.                begin
  459.                    repeat
  460.                        linecount := linecount + 1;
  461.                        currentline := currentline^.nextline;
  462.                        unpackline(scratchline,currentline);
  463.                        for index := 1 to scratchline.length do
  464.                            write(edfile,scratchline.chars[index]);
  465.                        writeln(edfile)
  466.                    until currentline=sentinel^.previousline
  467.                end;
  468.            running := false;
  469.            write ('EDIT FILE: ', filename, '  ');
  470.           errormessage (noerror,' REPLACED ***')
  471.        end;
  472.    writeln ('*** ',linecount : 1, '  LINE(S) SAVED')
  473. end; {stop}
  474.  
  475. procedure top(var commandline:linedef;var currentline:lineptr;
  476.                sentinel:lineptr;verify:boolean;var noerror:boolean);
  477. begin
  478.    endparse(commandline,noerror);
  479.    checkempty(sentinel,noerror);
  480.    if noerror then
  481.        begin
  482.            currentline:= sentinel^.nextline;
  483.            writeln ('*TOF');
  484.            if verify then printpackedline(currentline)
  485.        end
  486. end; {proc}
  487.  
  488. procedure verifyflag(var commandline:linedef;sentinel:lineptr;
  489.                      var verify:boolean; var noerror:boolean);
  490. var
  491.    command:commanddef;  legalcommand:boolean;
  492. begin
  493.    skipblanks(commandline);
  494.    getcommand(commandline,command,legalcommand,noerror);
  495.    if(commandline.position > commandline.length) or (not noerror) then
  496.        begin  { set flag }
  497.            endparse(commandline,noerror);
  498.            if noerror then
  499.                begin
  500.                   verify := not verify;
  501.                   writeln ('*CHANGED');
  502.                   if verify then writeln ('VERIFY SET') else writeln ('VERIFY NOT SET')
  503.                end
  504.        end
  505.    else
  506.        begin
  507.            endparse(commandline,noerror);
  508.            if noerror then
  509.                begin
  510.                    if command.chars='on     ' then verify := on
  511.                    else if command.chars='off    ' then verify := off
  512.                    else errormessage (noerror, 'INVALID SWITCH PARAMETER')
  513.                end
  514.        end
  515. end; {proc}
  516.  
  517. begin  { main module }
  518.    cls;
  519.    noerror := true;
  520.    writeln;
  521.    writeln;
  522.    write ('Input filename to edit:  (Include drive spec) ==> ');
  523.    readln (filename);
  524.    writeln;
  525.    write('[N]ew or [E]xisting file?  ==> ');
  526.    readln (filestats);
  527.    if filestats in ['E','e'] then
  528.        begin
  529.            assign(edfile,filename);
  530.            reset(edfile)
  531.        end
  532.    else if filestats in ['N','n'] then
  533.            begin
  534.                writeln ('New File');
  535.                writeln ('Files cannot be created with V1.10');
  536.                writeln ;
  537.                writeln ('Insert procedure will FAIL');
  538.                writeln;
  539.                writeln
  540.        end
  541.    else begin
  542.            writeln ('File select error, Restart');
  543.            writeln;
  544.            endxqq;
  545.            noerror := false
  546.         end;
  547.    writeln ('Editor :  Version: V1.1; PASCAL source');
  548.    writeln ;
  549.    writeln ('Execution begins...');
  550.    writeln ;
  551.    writeln ('VERIFY is set');
  552.    writeln;
  553.    writeln ('MODE> COMMAND');
  554.    writeln;
  555.    if noerror then noerror := true;
  556.    writeln;
  557.    writeln ('READING: ', filename, '       >>> WAIT ');
  558.    readfile(currentline,sentinel);
  559.    writeln ('*GO');
  560.    writeln;
  561.    checkempty(sentinel,noerror);
  562.    currentline := sentinel^.nextline;
  563.    isitacommand := false;
  564.    running := true;
  565.    verify := on;
  566.    with tablecommands do
  567.      begin
  568.        shortcommands[1]:='d';
  569.        shortcommands[2]:='i';
  570.        shortcommands[3]:='p';
  571.        shortcommands[4]:='c';
  572.        shortcommands[5]:='r';
  573.        shortcommands[6]:='f';
  574.        shortcommands[7]:='s';
  575.        shortcommands[8]:='v';
  576.        shortcommands[9]:='b';
  577.        shortcommands[10]:='n';
  578.        shortcommands[11]:='t';
  579.        shortcommands[12]:='a';
  580.        shortcommands[13]:='h';
  581.        shortcommands[14]:='=';
  582.        shortcommands[15]:=' ';
  583.        shortcommands[16]:=' ';
  584.        shortcommands[17]:=' ';
  585.        shortcommands[18]:=' ';
  586.        longcommands[1]:='delete ';
  587.        longcommands[2]:='insert ';
  588.        longcommands[3]:='print  ';
  589.        longcommands[4]:='change ';
  590.        longcommands[5]:='replace';
  591.        longcommands[6]:='find   ';
  592.        longcommands[7]:='stop   ';
  593.        longcommands[8]:='verify ';
  594.        longcommands[9]:='bottom ';
  595.        longcommands[10]:='next   ';
  596.        longcommands[11]:='top    ';
  597.        longcommands[12]:='append ';
  598.        longcommands[13]:='header ';
  599.        longcommands[14]:='       ';
  600.        longcommands[15]:='       ';
  601.        longcommands[16]:='abort  ';
  602.        longcommands[17]:='       ';
  603.      end; { with }
  604.    while running do
  605.        begin
  606.            noerror := true;
  607.            if isitacommand then isitacommand:=false
  608.            else readcommand('>',commandline);
  609.            processprefix(commandline,currentline,sentinel,noerror);
  610.            if noerror then
  611.                begin
  612.                    getcommand(commandline,command,legalcommand,noerror);
  613.                    if noerror then
  614.                        begin
  615.                            commandordinal(command,ordinal,tablecommands,noerror);
  616.                            if noerror then
  617.                                case ordinal of
  618.                                    1:delete(commandline,currentline,sentinel,verify,noerror);
  619.                                    2:insert(commandline,currentline,sentinel,isitacommand,noerror);
  620.                                    3:print(commandline,currentline,sentinel,verify,noerror);
  621.                                    4:change(commandline,currentline,sentinel,verify,noerror);
  622.                                    5:replace(commandline,currentline,sentinel,isitacommand,noerror);
  623.                                    6:find(commandline,currentline,sentinel,verify,noerror);
  624.                                    7:stop(commandline,sentinel,running,noerror);
  625.                                    8:verifyflag(commandline,sentinel,verify,noerror);
  626.                                    9:bottom(commandline,currentline,sentinel,verify,noerror);
  627.                                   10:next(commandline,currentline,sentinel,verify,noerror);
  628.                                   11:top(commandline,currentline,sentinel,verify,noerror);
  629.                                   12:append(commandline,currentline,sentinel,verify,noerror);
  630.                                   13:header(commandline,noerror);
  631.                                   14:equal(commandline,currentline);
  632.                                   16:abortt(commandline,noerror,running)
  633.                                end
  634.                        end
  635.                end
  636.        end;
  637.    writeln;  writeln;  writeln;
  638.    writeln ('Editor:  Version V1.1  --  Normal completion');
  639.    writeln ;
  640.    writeln ('Control restored to SYSTEM ')
  641. end.
  642.