• Aucun résultat trouvé

C - Character Command

Dans le document ISIS-II USER'S GUIDE (Page 69-74)

The C command moves the pointer a specified number of characters forward or backward in the file. You can specify an iterative parameter with the C command.

The parameter must precede the command code. A positive number (an unsigned number is assumed to be positive) moves the pointer forward the specified number of characters. A minus number moves the pointer backward. If no parameter is included, 1 is assumed. The parameter can be any number from -65,535 to +65,534.

If the beginning or end of the file is encountered before the specified number is reached, the pointer stops at the beginning or end.

The format of the C command is:

[n]C$$

where:

n specifies the number of characters the pointer is to be moved. A positive n specifies a forward movement and a negative n specifies a backward movement.

If n is omitted, 1 is assumed.

C is the command code.

C Command Examples: To move the pointer to the next character in the file:

*C$$

To move the pointer ahead 10 characters:

*10C$$

To move the pointer backward 100 characters:

*-100C$$

F - Find Command

The F command searches the file for a character string specified in the command.

The search begins at the current location of the pointer and continues until the string is found or the end of the file is encountered.

If the character string is found, the pointer is moved immediately following the last character of the string.

If the character string is not found, the pointer is not moved from its current loca-tion and following message is typed:

CAN NOT FIND "text"

*BREAK*

Where text is the character string specified in the command.

All characters must match for a match, including printing and non-printing characters (such as carriage return and line feed).

If the F command is included in a command string, an ESC or AL T MODE character must be used to terminate the character string or the following command will be used as part of the search argument.

The format of the F command is:

Ftext$$

where:

F is the command code.

text is the character string being searched for. The Editor only uses the first 16 characters in the string. Any characters beyond 16 are ignored.

F Command Examples: To find the character string "LOOPl" starting from the current location of the pointer:

* FLOOP1$$

To find the same character string but start the search from the beginning of the file:

*BFLOOP1$$

To find the same character string starting from the beginning of the file and then move the pointer to the beginning of the line containing the string:

* BFLOOP1 $OL$$

In the last example, if the ESC or AL T MODE character after the string had not been entered, the Editor would have searched for the string "LOOPlOL" and would not have found it.

Text Commands

The Editor contains commands to enter new text into a file, change existing text, delete an entire line, and delete a single character.

All of these commands affect the pointer. The effect on the pointer is described in each command description.

I - Insert Command

The I command inserts text into the file immediately before the pointer. All data following the I command is inserted into the file until a command terminator is entered. This includes carriage returns and line feeds.

The pointer is always immediately following the inserted data.

During initial entry of data into a file, the I command normally goes on for many lines, possibly for the entry of an entire program.

The format of the I command is:

Itext$$

where:

I is the command code.

text is the data to be entered. Any amount of text can be entered, from a single character to an entire file. The Editor keeps accepting data and inserting it into the file until the $$ is encountered.

I Command Examples: To enter a single character into the file where the pointer is located:

*IK$$

To enter a line to the beginning of the file:

*BIThis is the new line<CR>

$$

To enter extensive text at the end of an existing file:

*ZIThis is the start of the text<CR>

More text<CR>

Last line of text. <CR>

$$

S - Substitute Text Command

The S command finds a character string and substitutes another character string for it. The substitution is made only if the search results in an exact match.

After a successful match, the pointer is located immediately following the inserted data.

The S command starts its search from the current location of the pointer and con-tinues through the file until an exact match is found or until the end of the file is encountered.

If a match is not found in the search, the following message is displayed:

CANNOT FIND "text"

*BREAK*

Where text is the search argument.

There is no limit to the amount of data that can be inserted with the S command.

However, the search argument is limited to 16 characters. If more characters are entered for the search argument, only the first 16 are used and only the first 16 are replaced with the new text.

When using the S command, remember that it searches to the end of the file. If you make a typing error in the search argument and that exact string exists in the file, it will be changed by the S command. I t is a good idea to type the line just changed until you become experienced with the command.

The format of the S command is:

Sold-text[$new-text ]$$

where:

S is the command code.

old-text is the character string to be searched for and to be replaced if found.

Only the first 16 characters of old-text is used.

new-text is the character string that is to replace old-text. If new-text is omitted, the character string specified by old-text is deleted.

S Command Examples. To replace the string" JMP" with the string "CALL":

* SJ M P$CA LL$$

To make the same substitution but start the search from the beginning of the file:

*BSJMP$CALL$$

To make the same substitution, searching from the beginning and then typing the entire line in which the change was make:

* BSJ M P$CALL$OL T$$

To delete the first occurance of the string "START" from a file:

*SSTART$$

In the above example, no replacement data was supplied with the command. Thus, the command found the string and replaced it with nothing (deleted it).

D - Delete Command

The D command deletes the number of characters, starting at the pointer, specified in the command. If the iterative parameter is positive (or unsigned) the deletions are done from the pointer forward. If the parameter is negative, the deletions are done from the pointer backward. If the deletion is performed in a forward direction in the file, the pointer immediately precedes the first character not deleted. If the deletion is performed in a backward direction, the pointer immediately follows the first character not deleted. In other words, the pointer is between the remaining characters on either side of the deletion.

The format of the D command is:

[n]D$$

where:

n specifies the number of characters to be deleted. If n is positive, the deletion is performed in a forward direction and if n is negative the deletion is performed in a backward direction from the pointer. If n is omitted, 1 is assumed.

D is the command code.

D Command Examples. To delete the next 10 characters following the current pointer location:

*10D$$

To delete the 10 characters preceding the current pointer location:

*-10D$$

K - Kill Line Command

The K command deletes all the characters in a line beginning at the current location of the pointer. The characters in the line that precede the pointer are not deleted.

The K commands also deletes the carriage return and line feed at the end of the line.

An iterative parameter can be specified with the command. If the parameter is positive (or unsigned) the command deletes the remaining portion of the line con-taining the pointer and and the following lines until the command parameter is met or the end of the file is encountered. If the parameter is negative, the command starts at the pointer and deletes backward for the number of lines specified.

The format of the K command is:

[n]K$$

where:

n specifies the number of lines to be deleted. If n is positive the deletion is per-formed in a forward direction, and if it is negative the deletion is perper-formed in a backward direction. If n is omitted, 1 is assumed.

K is the command code.

K Command Examples. To delete an entire line, you must make sure the pointer is at the beginning of the line:

*OLK$$

To delete all the characters in a line from the pointer through the carriage return and line feed characters:

*K$$

To delete the entire line in which the pointer is located and the following three lines:

*OL4K$$

Dans le document ISIS-II USER'S GUIDE (Page 69-74)