• Keine Ergebnisse gefunden

THE CHANGE COMMAND

Im Dokument first title (Seite 115-118)

3) READY 3.2 POWER-ON

4.4 LINEEDIT - THE MOOS LINE EDITOR

4.4.22 THE CHANGE COMMAND

The first occurrences of a specified string in lines of the current text file can be replaced with a different string of same or different length by using the CHANGE command. The forms of this command are CHANGE. CHANGE linenumberl, or CHANGE linenumberl linenumber2.' CHANGE without a linenumber specified will change all lines in the buffer. CHANGE linenumberl will

change lines fr.om the line number specified to the end of the buffer. CHANGE linenumberl linenumber2 will change lines in the buffer starting at the

first line specified through the second line specified.

CHANGE operates on all lines within the specified range except lines starting with an asterisk (*) or semicolon (;). These lines are considered comment

lines in assembly language source text. Refer to the CHANGEALL command to operate on comment lines.

When the CHANGE command is entered, LINEEDIT will respond with the prompt SEARCH MASK 1. A string of up to 132 legal text line characters may be entered. The entry is terminated by pressing the return key. If no lines

in the current text file contain a match to the specified search mask, the message STRING NOT FOUND will be displayed. Otherwise, LINEEDIT will then respond with the prompt CHANGE TO 1. Another string of up to 132 legal text string characters can be entered. The entry is terminated by pressing the return key. LINEEDIT searches through lines in the current text file looking for the first occurrence within each line of a substring that matches the specified search mask. It replaces such occurrences with the specified change-to string, adjusting line and buffer length accordingly. Each line as changed is displayed on the console without tabs expanded.

The CHAN~E command also respects the universal match character capability as descrlbed under the SEARCH command. If the search mask contains one or

~re question marks (1) these characters positions will match any character 1n the search process, and the matched substring will then be replaced by the change-to string. Example:

Rev. 8 9/78 4-51

LIST

10 Sl@LABEL1A 20 S2@LABEL2A 30 @LABEL3 CHANGE

SEARCH MASK ? S?@

CHANGE TO ? @ 10 @LABELlA 20 @LABEL2A

The change-to string may also contain question marks (?). This provides the ability to retain specified character positions in the search string while making changes on either or both sides of the retained character. Example:

LIST 10 TAG01A 20 TAGOFF 30 TAG22A CHANGE

SEARCH MASK ? TAG??A CHANGE TO ? LASEL??B 10 LABEL01B

30 LABEL22B

Lines 10 and 30 have been changed while line 20 ;s unchanged because it did not match the search string. The TAG at the beginning and the A at the end of lines 10 and 30 have been changed. The 01 in line 10 and the 22 in line 30 have been retained.

4.4.23 THE CHANGEALL COMr~ND

The first occurrences of a specified string in all lines of the current text file, including those lines that begin with an asterisk (*). or

semicolon (;) can be replaced with a different string of same or different length by using the CHANGEALL command. The forms of this command are CHANGEALL. CHANGEALL 1inenumber1 t or CHANGEALL 1inenumber1 linenumber2.

When the CHANGEALL command is entered it functions the same as the CHANGE command, except that all text lines including those that begin with an asterisk (*) are included in the search.

4.4.24 THE EDIT COMr~ND

The text within a specified line in the current text file can be changed without retyping the entire line by using the EDIT command. EDIT linenumber

is the form of this command. If the specified linenumber is not found in the current text file. the message LINE NOT FOUND is displayed. LINEEDIT

processes an EDIT command by copying the specified 1 ine into a specia'l editing buffer and displaying the line number at the left margin of the console. An invisible edit pointer is set to point to the first character in the text line after the space that terminates the line number. LINEEDIT

;s now in the EDIT command mode. A separate set of single key commands is available for editing a line in the special edit buffer.

Rev. 8 9/78 4-52

4.4.24.1 ADVANCING THE EDIT POINTER - THE SPACE BAR

The invisible edit pointer in the special editing buffer may be advanced one position by pressing the space bar one time. The character to which the edit pointer is pointing will be displayed on the console. This indicates that the edit pointer has passed over the character. The edit pointer is then advanced so that it is now pointing at the next character in the text line immediately after the one that is displayed. The entire line can be displayed in this manner.

4.4.24.2 CHANGING THE NEXT CHARACTER - C

The character to which the edit pointer is pointing in the edit buffer can be changed by typing a c or C, followed by the new character.

The new character is printed on the console and replaces the character in the edit buffer at that position. The edit pointer is advanced to point to the character immediately after the new displayed character.

4.4.24.3 DELETING THE NEXT CHARACTER - D

The character to which the edit pointer is pointing in the edit buffer can be deleted by typing a d or D. The deleted character is printed on the console enclosed in backslashes (/). The edit pointer is left pointing at the character immediately after. the deleted character.

4.4.24.4 INSERTING CHARACTERS - I

Characters may be inserted into the line or at the end of the line by typing an i or I followed by the characters to be inserted. The insertion begins immediately before the character pointed to by

the edit pointer. Characters are inserted in sequence as typed until the ; nsert mode ; s termi na ted by, depressing the ESC key. The ed it

pointer remains pointing to the same character that it pointed to when the insertion began. The insert mode may also be terminated by pressing the return key. This also terminates the EDIT command and replaces the line in the current text file with the newly edited version from the special editing buffer.

4.4.24.5 LISTING THE LINE IN THE SPECIAL EDITING BUFFER - L

The remainder of the line in the special edit buffer from the position of the edit pointer to the end of the line may be displayed by typing an 1 or L. The characters are displayed on the console followed by a carriage return-line feed. The line number is reprinted at the left

margin of the console display and the edit pointer is reset to the beginning position. This command is useful to see what the line looks like before editing is completed. It may also be useful to use this command immediately after entering the original EDIT command. This would display the line

about to be edited without exiting the editing mode.

4-52.1

Rev. 8.3-A 7/1/79

4.4.24.6 SEARCHING TO A SPECIFIED CHARACTER - S

The edit pointer may be advanced in the special editing buffer to the first occurrence of a specified character by typing an s or S

followed by the character to search for. The characters from the position of the edit pointer up to but not including the searched for character are printed on the console. The edit pointer ;s left pOinting at the first occurrence of cne searched for character. If the search argument does not exist in the line then the entire line is printed and the edit pointer is positioned at the end of the line.

4.4.24.7 DELETING TO A SPECIFIED CHARACTER - K

Characters in the special editing buffer from the edit pointer position up to but not including a specified search character can be deleted by typing a k or K followed by the search character. The deleted

characters are displayed on the console, enclosed in backslashes (I).

If the search argument does not exist in the edit line. then all the characters from the edit pointer to the end of the line are deleted.

The edit pointer is left pointing at the search character or at the end of the line.

4.4.24.8 QUITTING THE EDIT COMMAND MODE - Q

The EDIT command may be aborted without changing the line in the current text file by typing a q or Q. The partially edited 1i.ne in the

special editing buffer is abandoned. No changes are made to the line in the current text file. LINEEDIT is ready to accept a new command.

4.4.24.9 COMPLETING THE EDIT COMMAND - THE RETURN KEY

The line in the special editing buffer can replace the line in the current text file at any point by pressing the return key. This terminates the EDIT command in a normal manner.

Im Dokument first title (Seite 115-118)