EDIT command: Difference between revisions
m (add more about names with leading zeroes) |
|||
(6 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"> | <p class="syntax"><b>E</b>DIT | ||
[({TERMINAL [SCREEN | LINE] | SCREEN [TERMINAL] | LINE [TERMINAL]})] | [({TERMINAL [SCREEN | LINE] | SCREEN [TERMINAL] | LINE [TERMINAL]})] | ||
[<span class="term">procnumber1</span> [,<span class="term">procnumber2</span> | ,<span class="term">procname1</span>] | [<span class="term">procnumber1</span> [,<span class="term">procnumber2</span> | ,<span class="term">procname1</span>] | ||
| [<span class="term">procname1</span> [,<span class="term">procname2</span> | <span class="term">procnumber1</span>]] | | [<span class="term">procname1</span> [,<span class="term">procname2</span> | ,<span class="term">procnumber1</span>]] | ||
</p> | </p> | ||
Line 21: | Line 21: | ||
<li>A temporary procedure (a negative number or zero).</li> | <li>A temporary procedure (a negative number or zero).</li> | ||
<li>A permanent procedure | <li>A permanent procedure. </li> | ||
</ul> | </ul> | ||
</td></tr> | If neither <var class="term">procnumber1</var> nor <var class="term">procname1</var> is specified, <var class="product">Model 204</var> creates a temporary procedure (0).</td></tr> | ||
<tr><th>procnumber2</th> | <tr><th>procnumber2</th> | ||
<td>The number of a new temporary procedure (a negative number or zero). <var class="term">procname2</var> is the name of a new procedure (1 to 255 characters); the name | <td>The number of a new temporary procedure (a negative number or zero). | ||
</td></tr> | |||
<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 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> | <table> | ||
<tr class="head"><th><p>Character name </p></th> | <tr class="head"><th><p>Character name </p></th> | ||
Line 60: | Line 84: | ||
<li>The procedure name can begin with a zero. And the procedure name "0123" is different from the procedure name "00123". | <li>The procedure name can begin with a zero. And the procedure name "0123" is different from the procedure name "00123". | ||
<p> | <p> | ||
However, names with only zeroes are treated as temporary procedure 0 | 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>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>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. | ||
Line 68: | Line 92: | ||
</ul> | </ul> | ||
<p> | <p> | ||
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> | |||
<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. | |||
<p class=" | |||
</ | |||
</p> | </p> | ||
==Examples== | ==Examples== | ||
Line 174: | Line 188: | ||
<td><p>Saves the edited procedure. </p></td> </tr> | <td><p>Saves the edited procedure. </p></td> </tr> | ||
<tr> <th><var><p>[SET] | <tr> <th><var><p>[SET] SCALE {OFF | ON}</p></var></th> | ||
<td><p>Controls the display of the column scale on the screen.</p> | <td><p>Controls the display of the column scale on the screen.</p> | ||
</td> </tr> | </td> </tr> | ||
Line 241: | Line 255: | ||
</table> | </table> | ||
[[Category: | [[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:
|
---|---|
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 |
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 toE 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 toE -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.
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.
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. |