Skip to content

EDIT (line)

Program Line Editor

This directive provides a way to edit single program lines without retyping the entire program line and provides for copying, replacing, deleting, and inserting strings of text in the line.

EDIT line-ref [edit-specifier [string-constant] ]
line-ref
is the program line number or label to be edited.
edit-specifier
is a letter or blank specifying the editing procedure to conduct on the program line.
[string-constant]
is any string constant (enclosed in brackets) that specifies text associated with edit-specifier.

In release levels starting with 8.3.1, the EDIT line-ref command provides a larger set of line-editing features. For example, EDIT 100 displays the line numbered 100. Press the F6 key to display on-line help and editing keys. After you edit the line you can press the Enter key to implement the changes.

Alternately, the EDIT directive can operate on a program line from left to right, including the full program line number or label. The edit-specifiers are:

C
copies text from the current position to the last character of the first occurrence of string-constant. This is the most common method of positioning in the program line.
R
replaces text in the program line with the text contained in string-constant, byte for byte, space for space.
D
deletes text in the program line from the current position through the first occurrence of string-constant.
Space
(absence of an edit-specifier) inserts string-constant into the program line starting at current position.
Enter
ends the EDIT directive and copies the program line from current position to the end.

If the EDIT directive is used to change a program line number, the original program line is retained and the edited program line is inserted in the program in the correct position.

This directive can be used only in Thoroughbred Basic Console Mode.

If a match is not found in the program line for string-constant when using “C” or “D” edit-specifiers, an ERR=20 results.

EDIT 100

displays program line 100, which can be edited without recourse to edit-specifiers.

*ERR
00100 IF X=10 ORRY =123 THEN GOTO 678

To correct the above program line number or label we could use:

EDIT 100 C[OR]D[R]

which lists as:

00100 IF X=10 OR Y=123 THEN GOTO 00678

The program line is copied to OR, the second R is deleted, and the carriage return copies the remainder of the program line.

00010 DIM ARRAY$[ 10,5 ] (10,"*")

could have its first dimension changed from 10 to 100 with:

EDIT 10 C[[ 1][0]

which copies out to “[ 1” and inserts an extra “0”.

EDIT full-screen, EDIT recall, and EDITF directives
Description of EDIT in the Thoroughbred Basic Utilities Manual

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF