EDIT command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by 3 users not shown)
Line 6: Line 6:
<dd>Invokes the <var class="product">Model&nbsp;204</var> full-screen editor or line editor
<dd>Invokes the <var class="product">Model&nbsp;204</var> full-screen editor or line editor
</dl>
</dl>
==Syntax==
==Syntax==
<p class="syntax">EDIT
<p class="syntax"><b>E</b>DIT
  [({TERMINAL [SCREEN | LINE] | SCREEN [TERMINAL]
  [({TERMINAL [SCREEN | LINE] | SCREEN [TERMINAL] | LINE [TERMINAL]})]  
| LINE [TERMINAL]})]  
  [<span class="term">procnumber1</span> [,<span class="term">procnumber2</span> | ,<span class="term">procname1</span>]
  [<i>procnumber1</i> [,<i>procnumber2</i> | ,<i>procname1</i>]
  | [<span class="term">procname1</span> [,<span class="term">procname2</span> | ,<span class="term">procnumber1</span>]]
  | [<i>procname1</i> [,<i>procname2</i> | <i>procnumber1</i>]]
</p>
</p>
   
   
<b>Where:</b>
Where:
<table>  
<table>  
<tr>
<tr><th>procnumber1</th>
<th>procnumber1</th>
<td>The number of an existing procedure. One of these:
<td> is the number of an existing
<ul>  
<ul>  
<li>
<li>A temporary procedure (a negative number or zero).</li>
<p>Temporary procedure (a negative number or zero).</p>
</li>
   
   
<li>
<li>A permanent procedure. </li>
<p>Permanent procedure. If neither <i>procnumber1</i> nor <i>procname1</i> is specified, <var class="product">Model&nbsp;204</var> creates a temporary procedure (0).</p>
</ul>
</li>
If neither <var class="term">procnumber1</var> nor <var class="term">procname1</var> is specified, <var class="product">Model&nbsp;204</var> creates a temporary procedure (0).</td></tr>
</ul>
</td>
</tr>
   
   
<tr>
<tr><th>procnumber2</th>
<th>procnumber2</th>
<td>The number of a new temporary procedure (a negative number or zero).  
<td> is the number of a new temporary procedure (a negative number or zero). procname2 is the name of a new procedure (1 to 255 characters); the name can contain any letters, numbers, or symbols except:
</td></tr>
<table>
 
<tr><th>procname1</th>
<td>If specified after <var class="term">procnumber1</var>, the name under which the procedure is saved after editing. See [[#Procedure names|Procedure names]], below, for naming rules.
<p>
If specified immediately after <code>EDIT</code>, this is the name of an existing temporary or permanent procedure to be used as input for the current editing session.</p></td></tr>
 
<tr><th>procname2</th>
<td><var class="term">procname2</var> is the name of a new procedure (1 to 255 characters). See [[#Procedure names|Procedure names]], below for naming rules. </td></tr>
</table>
 
===Syntax notes===
You invoke the Full Screen Editor by entering:
<p class="syntax">EDIT (SCREEN) <span class="term">name</span>
</p>
<p>
where <var class="term">name</var> identifies the procedure to be edited. If this is entered from a line-at-a-time terminal, however, an error message is issued stating that a full-screen terminal is required. You invoke the Line Editor by entering:</p>
<p class="code">EDIT (LINE) <i>name</i>
</p>
<p>
If neither <var>SCREEN</var> nor <var>LINE</var> is specified, <var class="product">Model&nbsp;204</var> invokes the appropriate Editor for your terminal type.</p>
 
===Procedure names===
The name of a new procedure may contain any letters, numbers, or symbols except:
<table
<tr class="head"><th><p>Character name </p></th>
<th><p>Keyboard display</p></th> </tr>
    
    
<tr> <th>
<tr> <th><var><p>Carriage return</p></var></th>  
<p>Character name </p>
<td></td> </tr>
</th> <th>
<p>Keyboard display</p>
</th> </tr>
 
<tr> <th><var>
<p>Carriage return</p>
</var></th> <td></td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Comma </p></var></th>  
<p>Comma </p>
<td><p>( , ) </p></td> </tr>
</var></th> <td>
<p>( , ) </p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Equal sign </p></var></th>  
<p>Equal sign </p>
<td><p>( = )</p></td> </tr>
</var></th> <td>
<p>( = )</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Semicolon </p></var></th>  
<p>Semicolon </p>
<td><p>( ; )</p></td> </tr>
</var></th> <td>
<p>( ; )</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Single quote </p></var></th>  
<p>Single quote </p>
<td><p>( ' )</p></td> </tr>
</var></th> <td>
<p>( ' )</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Space</p></var></th>  
<p>Space</p>
<td></td> </tr>   
</var></th> <td></td> </tr>   
</table>
</table>
<p>
In addition: </p>
<ul>
<li>In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.</li>


In addition:
<li>As of version 7.7:
<ul>
<ul>
<li>
<li>Most of the above characters are permitted if <var>CUSTOM=42</var> is turned on. Names containing special characters must be enclosed in single quotes for all procedure commands. See [[CUSTOM parameter#Using CUSTOM=(42)|Using CUSTOM=(42)]] for details.</li>
In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.</li>
 
<li>
<li>The procedure name can begin with a zero. And the procedure name "0123" is different from the procedure name "00123".
As of version 7.7:
<p>
<ul>
However, names with only zeroes are treated as temporary procedure 0, so <code>E 000</code> is identical to <code>E 0</code>. </p></li>
<li>
 
Most of the above characters are permitted if <var>CUSTOM=42</var> is turned on. Names containing special characters must be enclosed in single quotes for all procedure commands. See [[CUSTOM_parameter#Using_CUSTOM=(42)|Using CUSTOM=(42)]] for details.</li>
<li>Alphanumeric procedure names can begin with a minus sign character (<tt>-</tt>), which is interpreted as a hyphen. For example, <code>-1myproc</code> and <code>-myproc</code> are valid procedure names.
<li>The procedure name can begin with a zero.</li>
<p>
<li>Alphanumeric procedure names can begin with a minus sign character (-), which is interpreted as a dash. For example, -1myproc and -myproc are valid procedure names.</li>
Numeric procedure names that begin with a minus sign are treated as temporary procedures, and leading zeroes after the minus sign are ignored if they are followed by a non-zero digit (<code>E -1</code> is identical to <code>E -001</code>). </p></li>
</li>
</ul></li>
</ul>
</ul>
</li>
<p>
</ul>
While procedure names up to 255 characters are technically valid, very long names will create challenges in maintaining the procedures due to the procedure name needing to fit on the same line as commands that reference the procedure. Rocket recommends keeping procedure names shorter than 210 characters. </p>
</td>
<p class="note"><b>Note:</b> [[SirLib]] users <b>must</b> keep procedure names shorter than 229, and even then, SirPro will not be able to display procedure names longer than the supported screen width.
</tr>
</table>
 
===Syntax notes===
You invoke the Full Screen Editor by entering:
<p class="syntax">EDIT (SCREEN) name
</p>
</p>
<p>where name identifies the procedure to be edited. If this is entered from a line-at-a-time terminal, however, an error message is issued stating that a full-screen terminal is required. You invoke the Line Editor by entering:</p>
<p class="code">EDIT (LINE) name
</p>
<p>If neither SCREEN nor LINE is specified, <var class="product">Model&nbsp;204</var> invokes the appropriate Editor for your terminal type.</p>


==Examples==
==Examples==
Line 110: Line 102:
EDIT -1   
EDIT -1   
</p>
</p>
==Usage notes==
==Usage notes==
<p>The EDIT command invokes either the Full Screen Editor or the Line Editor. EDIT can optionally specify the name or number of an existing procedure to be edited, and can specify a new name or number for the edited procedure. Specifying 0 or a negative number edits a temporary procedure. If no name or number is supplied, temporary procedure 0 is assumed.</p>
<ul>
<p>You can invoke either of the <var class="product">Model&nbsp;204</var> Editors from within a procedure and have the Editor go directly to your terminal for input. Entering the following command directs an editing session to your terminal:</p>
<li>The <var>EDIT</var> command invokes either the Full Screen Editor or the Line Editor. <var>EDIT</var> can optionally specify the name or number of an existing procedure to be edited, and can specify a new name or number for the edited procedure. Specifying 0 or a negative number edits a temporary procedure. If no name or number is supplied, temporary procedure 0 is assumed.</li>
<p class="syntax">EDIT (TERMINAL) <span class="term">procname</span>  
 
</p>
<li>You can invoke either of the <var class="product">Model&nbsp;204</var> Editors from within a procedure and have the Editor go directly to your terminal for input. Entering the following command directs an editing session to your terminal:
<p><var class="product">Model&nbsp;204</var> selects either the Full Screen Editor or the Line Editor for the user running the procedure. The Editor reads input from the terminal until you end the session with an END, GO, or QUIT command. If END or QUIT is entered, <var class="product">Model&nbsp;204</var> reads the next line of input from the procedure containing the EDIT command. If GO is entered, <var class="product">Model&nbsp;204</var> reads the next line of input from the edited procedure, as if the EDIT command were followed by an INCLUDE command.</p>
<p class="syntax">EDIT (TERMINAL) <span class="term">procname</span></p>
<p>The TERMINAL option can be combined with either the SCREEN or LINE options. If an EDIT (SCREEN) command is issued from within a procedure, <var class="product">Model&nbsp;204</var> displays a message that the SCREEN option requires the TERMINAL option. If an EDIT command without the TERMINAL option is issued within a procedure, the line editor is invoked. It reads editor commands from the invoking procedure. Including the TERMINAL option in an EDIT command issued from the terminal has no effect on the operation of the EDIT command.</p>
</li>
 
<li><var class="product">Model&nbsp;204</var> selects either the Full Screen Editor or the Line Editor for the user running the procedure. The Editor reads input from the terminal until you end the session with an <var>END</var>, <var>GO</var>, or <var>QUIT</var> command. If <var>END</var> or <var>QUIT</var> is entered, <var class="product">Model&nbsp;204</var> reads the next line of input from the procedure containing the <var>EDIT</var> command. If <var>GO</var> is entered, <var class="product">Model&nbsp;204</var> reads the next line of input from the edited procedure, as if the <var>EDIT</var> command were followed by an <var>INCLUDE</var> command.</li>
 
<li>The <var>TERMINAL</var> option can be combined with the <var>SCREEN</var> or the <var>LINE</var> option. If an <var>EDIT (SCREEN)</var> command is issued from within a procedure, <var class="product">Model&nbsp;204</var> displays a message that the <var>SCREEN</var> option requires the <var>TERMINAL</var> option. If an <var>EDIT</var> command without the <var>TERMINAL</var> option is issued within a procedure, the line editor is invoked. It reads editor commands from the invoking procedure. Including the <var>TERMINAL</var> option in an <var>EDIT</var> command issued from the terminal has no effect on the operation of the <var>EDIT</var> command.</li>
 
<li>When it processes <var>EDIT</var> against a permanent procedure, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins a non-backoutable update unit. For more information about <var class="product">Model&nbsp;204</var> update units, see [[File integrity and recovery]].</li>
</ul>


<p>When it processes EDIT against a permanent procedure, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins a non-backoutable update unit. For more information about <var class="product">Model&nbsp;204</var> update units, see [[File integrity and recovery]].</p>
==Editor commands==
<p>The following tables summarize the available full-screen editor and line editor commands. In all commands that refer to procedure name (procname), a procedure number can be specified to refer to a temporary procedure. For more information, see the [[:Category: Model 204 editor|Model 204 editor]] topics.</p>
<p>
The following tables summarize the available full-screen editor and line editor commands. In all commands that refer to procedure name (procname), a procedure number can be specified to refer to a temporary procedure. For more information, see the [[:Category: Model 204 editor|Model 204 editor]] topics.</p>
<table>
<table>
<caption> Full Screen Editor commands </caption>
<caption> Full Screen Editor commands </caption>  
   
<tr class="head"><th>Command</th>  
<tr> <th>
<th>Action</th></tr>
<p>Command</p>
</th> <th>
<p>Action</p>
</th> </tr>
    
    
<tr> <th><var>
<tr> <th><var><p>[+] n</p></var></th>  
<p>[+] n</p>
<td><p>Scrolls forward n lines in a procedure.</p></td> </tr>
</var></th> <td>
<p>Scrolls forward n lines in a procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>-n</p></var></th>  
<p>-n</p>
<td><p>Scrolls backward n lines in a procedure.</p></td> </tr>
</var></th> <td>
<p>Scrolls backward n lines in a procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>=</p></var></th>  
<p>=</p>
<td><p>Repeats the command most recently executed.</p></td> </tr>
</var></th> <td>
<p>Repeats the command most recently executed.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[SET] ARBCHAR [OFF]</p></var></th>  
<p>[SET] ARBCHAR [OFF]</p>
<td><p>Sets an arbitrary (wild) character for search string.</p></td> </tr>
</var></th> <td>
<p>Sets an arbitrary (wild) character for search string.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>BACKWARD</p></var></th>  
<p>BACKWARD</p>
<td><p>Scrolls backward n screens in a procedure.</p></td> </tr>
</var></th> <td>
<p>Scrolls backward n screens in a procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>BOTTOM</p></var></th>  
<p>BOTTOM</p>
<td><p>Scrolls to last line of a procedure.</p></td> </tr>
</var></th> <td>
<p>Scrolls to last line of a procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>CLEAR</p></var></th>  
<p>CLEAR</p>
<td><p>Clears the prefix area, aborts pending prefix commands, and cancels any specified targets.</p></td> </tr>
</var></th> <td>
<p>Clears the prefix area, aborts pending prefix commands, and cancels any specified targets.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[IN filename] END [procname]</p></var></th>  
<p>[IN filename] END [procname]</p>
<td><p>Exits from the Editor and saves the edited procedure.</p></td> </tr>
</var></th> <td>
<p>Exits from the Editor and saves the edited procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>{SET] FILL {NULL | BLANK}</p></var></th>  
<p>{SET] FILL {NULL | BLANK}</p>
<td><p>Sets a fill character.</p></td> </tr>
</var></th> <td>
<p>Sets a fill character.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>FORWARD</p></var></th>  
<p>FORWARD</p>
<td><p>Scrolls forward n screens in a procedure.</p></td> </tr>
</var></th> <td>
<p>Scrolls forward n screens in a procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[IN filename] GET procname</p></var></th>  
<p>[IN filename] GET procname</p>
<td><p>Inserts a saved procedure in the procedure being edited.</p>
</var></th> <td>
<p>Inserts a saved procedure in the procedure being edited.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[IN filename] GO [procname]</p></var></th>  
<p>[IN filename] GO [procname]</p>
<td><p>Exits from the Full Screen Editor, saves the edited procedure, and includes the procedure.</p></td> </tr>
</var></th> <td>
<p>Exits from the Full Screen Editor, saves the edited procedure, and includes the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[SET] LINEND {OFF | char}</p></var></th>  
<p>[SET] LINEND {OFF | char}</p>
<td><p>Sets the line-end character.</p></td> </tr>
</var></th> <td>
<p>Sets the line-end character.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[-] LOCATE /string  [[IN] RANGE]</p></var></th>  
<p>[-] LOCATE /string  [[IN] RANGE]</p>
<td><p>Locates the specified string in a procedure</p></td> </tr>
</var></th> <td>
<p>Locates the specified string in a procedure</p>
</td> </tr>
    
    
<tr> <th><var>
<tr> <th><var><p>[SET] PREFIX {RIGHT | LEFT}</p></var></th>  
<p>[SET] PREFIX {RIGHT | LEFT}</p>
<td><p>Controls the position of the prefix area on the screen.</p>
</var></th> <td>
<p>Controls the position of the prefix area on the screen.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>QUIT [QUIT] </p></var></th>  
<p>QUIT [QUIT] </p>
<td><p>Exits from the Editor; does not save the edited procedure.</p>
</var></th> <td>
<p>Exits from the Editor; does not save the edited procedure.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[SET] REPEAT {OFF | char}</p></var></th>  
<p>[SET] REPEAT {OFF | char}</p>
<td><p>Sets the repeat character for search strings.</p></td> </tr>
</var></th> <td>
<p>Sets the repeat character for search strings.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>REPLACE /string1/string2/ [n |*] [VERIFY] [[IN] RANGE]</p></var></th>  
<p>REPLACE /string1/string2/ [n |*] [VERIFY] [[IN] RANGE]</p>
<td><p>Locates and replaces the specified string in a procedure.</p>
</var></th> <td>
<p>Locates and replaces the specified string in a procedure.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[IN filename] SAVE </p><p> [procname] [[IN] RANGE] </p>
<p>[IN filename] SAVE </p>
</var></th>  
<p> [procname] [[IN] RANGE] </p>
<td><p>Saves the edited procedure. </p></td> </tr>
</var></th> <td>
<p>Saves the edited procedure. </p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[SET] SCALE {OFF | ON}</p></var></th>  
<p>[SET] SCA;E {OFF | ON}</p>
<td><p>Controls the display of the column scale on the screen.</p>
</var></th> <td>
<p>Controls the display of the column scale on the screen.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>TOP</p></var></th>  
<p>TOP</p>
<td><p>Scrolls to the first line of a procedure. </p></td> </tr>
</var></th> <td>
<p>Scrolls to the first line of a procedure. </p>
</td> </tr>
 
</table>
</table>
<p>The table below lists the Line Editor commands. </p>
 
<p>
The table below lists the Line Editor commands. </p>
<table>
<table>
<caption>Line Editor commands</caption>
<caption>Line Editor commands</caption>  
   
<tr class="head"><th><p>Command</p></th>  
<tr> <th>
<th><p>Action</p></th> </tr>
<p>Command</p>
</th> <th>
<p>Action</p>
</th> </tr>
    
    
<tr> <th><var>
<tr> <th><var><p>[n] (commands)</p></var></th>  
<p>[n] (commands)</p>
<td><p>Repeats a series of commands n times.</p></td> </tr>
</var></th> <td>
<p>Repeats a series of commands n times.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] C</p></var></th>  
<p>[n] C</p>
<td><p>Moves the pointer n characters right or left in the procedure.</p>
</var></th> <td>
<p>Moves the pointer n characters right or left in the procedure.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] D</p></var></th>  
<p>[n] D</p>
<td><p>Deletes n characters in the procedure.</p></td> </tr>
</var></th> <td>
<p>Deletes n characters in the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[procname] END</p></var></th>  
<p>[procname] END</p>
<td><p>Exits from the Line Editor and saves the edited procedure.</p>
</var></th> <td>
<p>Exits from the Line Editor and saves the edited procedure.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[procname] GO</p></var></th>  
<p>[procname] GO</p>
<td><p>Exits from the Line Editor, saves the edited procedure, and includes the procedure.</p></td> </tr>
</var></th> <td>
<p>Exits from the Line Editor, saves the edited procedure, and includes the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[procname] I</p></var></th>  
<p>[procname] I</p>
<td><p>Combines procedures.</p></td> </tr>
</var></th> <td>
<p>Combines procedures.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>I/string/</p></var></th>  
<p>I/string/</p>
<td><p>Inserts a string before the current pointer.</p></td> </tr>
</var></th> <td>
<p>Inserts a string before the current pointer.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] J</p></var></th>  
<p>[n] J</p>
<td><p>Initializes the pointer at the first character in a procedure or moves it forward or backward n lines.</p></td> </tr>
</var></th> <td>
<p>Initializes the pointer at the first character in a procedure or moves it forward or backward n lines.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] [H] K</p></var></th>  
<p>[n] [H] K</p>
<td><p>Deletes n lines from the procedure.</p></td> </tr>
</var></th> <td>
<p>Deletes n lines from the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] L</p></var></th>  
<p>[n] L</p>
<td><p>Moves pointer n lines forward or backward in the procedure.</p>
</var></th> <td>
<p>Moves pointer n lines forward or backward in the procedure.</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th nowrap><var><p>[n] R/string1/string2/</p></var></th>  
<p>[n] R/string1/</p>
<td><p>Replaces a specified string in the procedure.</p></td> </tr>
<p>      string2/</p>
</var></th> <td>
<p>Replaces a specified string in the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] S/string/</p></var></th>  
<p>[n] S/string/</p>
<td><p>Searches for an occurrence of a specified string in the procedure.</p></td> </tr>
</var></th> <td>
<p>Searches for an occurrence of a specified string in the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>[n] [H] T</p></var></th>  
<p>[n] [H] T</p>
<td><p>Displays a portion of the procedure being edited.</p></td> </tr>
</var></th> <td>
<p>Displays a portion of the procedure being edited.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Xline</p></var></th>  
<p>Xline</p>
<td><p>Replaces a line in the procedure.</p></td> </tr>
</var></th> <td>
<p>Replaces a line in the procedure.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Yline</p></var></th>  
<p>Yline</p>
<td><p>Inserts a line before the line at which the pointer is positioned.</p></td> </tr>
</var></th> <td>
<p>Inserts a line before the line at which the pointer is positioned.</p>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var><p>Z</p></var></th>  
<p>Z</p>
<td><p>Positions the pointer after the last character in the procedure. </p></td> </tr>  
</var></th> <td>
<p>Positions the pointer after the last character in the procedure.   </p>
</td> </tr>
 
</table>
</table>
[[Category: General user commands]]
 
[[Category: User commands]]
[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 22:31, 26 January 2022

Summary

Privileges
Any user
Function
Invokes the Model 204 full-screen editor or line editor

Syntax

EDIT [({TERMINAL [SCREEN | LINE] | SCREEN [TERMINAL] | LINE [TERMINAL]})] [procnumber1 [,procnumber2 | ,procname1] | [procname1 [,procname2 | ,procnumber1]]

Where:

procnumber1 The number of an existing procedure. One of these:
  • A temporary procedure (a negative number or zero).
  • A permanent procedure.
If neither procnumber1 nor procname1 is specified, Model 204 creates a temporary procedure (0).
procnumber2 The number of a new temporary procedure (a negative number or zero).
procname1 If specified after procnumber1, the name under which the procedure is saved after editing. See Procedure names, below, for naming rules.

If specified immediately after EDIT, this is the name of an existing temporary or permanent procedure to be used as input for the current editing session.

procname2 procname2 is the name of a new procedure (1 to 255 characters). See Procedure names, below for naming rules.

Syntax notes

You invoke the Full Screen Editor by entering:

EDIT (SCREEN) name

where name identifies the procedure to be edited. If this is entered from a line-at-a-time terminal, however, an error message is issued stating that a full-screen terminal is required. You invoke the Line Editor by entering:

EDIT (LINE) name

If neither SCREEN nor LINE is specified, Model 204 invokes the appropriate Editor for your terminal type.

Procedure names

The name of a new procedure may contain any letters, numbers, or symbols except:

Character name

Keyboard display

Carriage return

Comma

( , )

Equal sign

( = )

Semicolon

( ; )

Single quote

( ' )

Space

In addition:

  • In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.
  • As of version 7.7:
    • Most of the above characters are permitted if CUSTOM=42 is turned on. Names containing special characters must be enclosed in single quotes for all procedure commands. See Using CUSTOM=(42) for details.
    • The procedure name can begin with a zero. And the procedure name "0123" is different from the procedure name "00123".

      However, names with only zeroes are treated as temporary procedure 0, so E 000 is identical to E 0.

    • Alphanumeric procedure names can begin with a minus sign character (-), which is interpreted as a hyphen. For example, -1myproc and -myproc are valid procedure names.

      Numeric procedure names that begin with a minus sign are treated as temporary procedures, and leading zeroes after the minus sign are ignored if they are followed by a non-zero digit (E -1 is identical to E -001).

While procedure names up to 255 characters are technically valid, very long names will create challenges in maintaining the procedures due to the procedure name needing to fit on the same line as commands that reference the procedure. Rocket recommends keeping procedure names shorter than 210 characters.

Note: SirLib users must keep procedure names shorter than 229, and even then, SirPro will not be able to display procedure names longer than the supported screen width.

Examples

EDIT EDIT (SCREEN) PROC1 EDIT XUPDTE EDIT -1

Usage notes

  • The EDIT command invokes either the Full Screen Editor or the Line Editor. EDIT can optionally specify the name or number of an existing procedure to be edited, and can specify a new name or number for the edited procedure. Specifying 0 or a negative number edits a temporary procedure. If no name or number is supplied, temporary procedure 0 is assumed.
  • You can invoke either of the Model 204 Editors from within a procedure and have the Editor go directly to your terminal for input. Entering the following command directs an editing session to your terminal:

    EDIT (TERMINAL) procname

  • Model 204 selects either the Full Screen Editor or the Line Editor for the user running the procedure. The Editor reads input from the terminal until you end the session with an END, GO, or QUIT command. If END or QUIT is entered, Model 204 reads the next line of input from the procedure containing the EDIT command. If GO is entered, Model 204 reads the next line of input from the edited procedure, as if the EDIT command were followed by an INCLUDE command.
  • The TERMINAL option can be combined with the SCREEN or the LINE option. If an EDIT (SCREEN) command is issued from within a procedure, Model 204 displays a message that the SCREEN option requires the TERMINAL option. If an EDIT command without the TERMINAL option is issued within a procedure, the line editor is invoked. It reads editor commands from the invoking procedure. Including the TERMINAL option in an EDIT command issued from the terminal has no effect on the operation of the EDIT command.
  • When it processes EDIT against a permanent procedure, Model 204 ends any update unit in progress and begins a non-backoutable update unit. For more information about Model 204 update units, see File integrity and recovery.

Editor commands

The following tables summarize the available full-screen editor and line editor commands. In all commands that refer to procedure name (procname), a procedure number can be specified to refer to a temporary procedure. For more information, see the Model 204 editor topics.

Full Screen Editor commands
Command Action

[+] n

Scrolls forward n lines in a procedure.

-n

Scrolls backward n lines in a procedure.

=

Repeats the command most recently executed.

[SET] ARBCHAR [OFF]

Sets an arbitrary (wild) character for search string.

BACKWARD

Scrolls backward n screens in a procedure.

BOTTOM

Scrolls to last line of a procedure.

CLEAR

Clears the prefix area, aborts pending prefix commands, and cancels any specified targets.

[IN filename] END [procname]

Exits from the Editor and saves the edited procedure.

{SET] FILL {NULL | BLANK}

Sets a fill character.

FORWARD

Scrolls forward n screens in a procedure.

[IN filename] GET procname

Inserts a saved procedure in the procedure being edited.

[IN filename] GO [procname]

Exits from the Full Screen Editor, saves the edited procedure, and includes the procedure.

[SET] LINEND {OFF | char}

Sets the line-end character.

[-] LOCATE /string [[IN] RANGE]

Locates the specified string in a procedure

[SET] PREFIX {RIGHT | LEFT}

Controls the position of the prefix area on the screen.

QUIT [QUIT]

Exits from the Editor; does not save the edited procedure.

[SET] REPEAT {OFF | char}

Sets the repeat character for search strings.

REPLACE /string1/string2/ [n |*] [VERIFY] [[IN] RANGE]

Locates and replaces the specified string in a procedure.

[IN filename] SAVE

[procname] [[IN] RANGE]

Saves the edited procedure.

[SET] SCALE {OFF | ON}

Controls the display of the column scale on the screen.

TOP

Scrolls to the first line of a procedure.

The table below lists the Line Editor commands.

Line Editor commands

Command

Action

[n] (commands)

Repeats a series of commands n times.

[n] C

Moves the pointer n characters right or left in the procedure.

[n] D

Deletes n characters in the procedure.

[procname] END

Exits from the Line Editor and saves the edited procedure.

[procname] GO

Exits from the Line Editor, saves the edited procedure, and includes the procedure.

[procname] I

Combines procedures.

I/string/

Inserts a string before the current pointer.

[n] J

Initializes the pointer at the first character in a procedure or moves it forward or backward n lines.

[n] [H] K

Deletes n lines from the procedure.

[n] L

Moves pointer n lines forward or backward in the procedure.

[n] R/string1/string2/

Replaces a specified string in the procedure.

[n] S/string/

Searches for an occurrence of a specified string in the procedure.

[n] [H] T

Displays a portion of the procedure being edited.

Xline

Replaces a line in the procedure.

Yline

Inserts a line before the line at which the pointer is positioned.

Z

Positions the pointer after the last character in the procedure.