EDIT command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 35: Line 35:
<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> 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:
<table>
<table>
   
 
<tr> <th>
<tr> <th>
<p>Character name </p>
</th> <th>
<p>Keyboard display </p>
</th> <th>
<p>Character name </p>
<p>Character name </p>
</th> <th>
</th> <th>
Line 47: Line 43:
    
    
<tr> <th><var>
<tr> <th><var>
<p>Space </p>
<p>Carriage return</p>
</var></th> <td></td> <td>
</var></th> <td></td> </tr>
<tr> <th><var>
<p>Comma </p>
</var></th> <td>
<p>( , ) </p>
</td> </tr>
<tr> <th><var>
<p>Equal sign </p>
<p>Equal sign </p>
</td> <td>
</var></th> <td>
<p>(=)</p>
<p>( = )</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>
<p>Comma </p>
<p>Semicolon </p>
</var></th> <td>
</var></th> <td>
<p>(,)</p>
<p>( ; )</p>
</td> <td>
</td> </tr>
<tr> <th><var>
<p>Single quote </p>
<p>Single quote </p>
</td> <td>
</var></th> <td>
<p>(')</p>
<p>( ' )</p>
</td> </tr>
</td> </tr>
   
   
<tr> <th><var>
<tr> <th><var>
<p>Semicolon</p>
<p>Space</p>
</var></th> <td>
</var></th> <td></td> </tr>
<p>(;) </p>
</td> <td>
<p>Carriage return </p>
</td> <td></td> </tr>
 
</table>
</table>
<p class="note"><b>Note:</b> Most of the above characters are permitted if <var>[[CUSTOM_parameter|CUSTOM]]</var>=42 is turned on.</p>


<p>The procedure names cannot begin with a minus sign.</p>
In addition:
<p>And in version 7.6 and lower, the procedure names cannot begin with a zero.</p></td>
<ul>
<li>
In version 7.6 and earlier, the procedure name cannot begin with a zero or a minus sign.</li>
<li>
As of version 7.7:
<ul>
<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>The procedure name can begin with a zero.</li>
<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>
</li>
</ul>
</li>
</ul>
</td>
</tr>
</tr>
   
   

Revision as of 21:07, 11 April 2016

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 is the number of an existing
  • Temporary procedure (a negative number or zero).

  • Permanent procedure. If neither procnumber1 nor procname1 is specified, Model 204 creates a temporary procedure (0).

procnumber2 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:

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.
    • 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.

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.

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 either the SCREEN or LINE options. 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.

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] SCA;E {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.