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