Extended Line Command Modifiers
Contents of Article
Standard command forms with modifiers
Forward and backward modifiers
Post-exclude and post-unexclude modifiers
Introduction
Many line commands support the use of Extended Line Command Modifiers. These are optional characters appended to the right end of a line command, requesting additional special processing to be performed.
Standard command forms with modifiers
The standard form of a line command with a modifier is is to place the modifier after the command name, rather than the end of the command as a whole.
For example, if a command to copy 5 lines (C5) was to be retained with a & modifier, the standard form is C&5 rather than C5&. The standard way to lower-case 3 lines and then exclude them following the operation would be with a command LC-3 rather than LC3-.
However, SPFLite also accepts commands with modifiers in non-standard forms. When the display is refreshed, commands are redisplayed in their standard form. If you enter the command C5&, it will be redisplayed as C&5.
The addition of the modifier & to a line command requests that the command be retained on the line following completion of the command rather than having the command disappear when completed. This is similar to the use of & prefix on the primary command line to retain the primary command.
This could be used, for example, when copying a range of line commands with a pair of CC commands and you will be copying these lines to multiple scattered locations. If the CC commands are entered as CC& commands and the destination as A then following completion of the copy, the CC& commands will remain on the selected lines awaiting placement of the next A line command for the next copy operation. When all copies are done, the CC& can be manually blanked, or cleared with a RESET COMMAND command, usually abbreviated as RES CMD.
Note: Once a command is "retained" on a line using &, a simple RESET command without CMD will not clear it.
If you enter a pair of block commands, one with & and one without &, the command without & will be "promoted" to one with the & on it. For example, if you enter CC on one line and CC& on another, the CC will be changed into CC&.
The & line command option can be used with the A, B, C, CC, H, HH, O, OO, OR, and ORR
Forward and backward modifiers
For line commands that accept a 'number of lines' operand, the Forward modifier / and the Backward modifier \ may be used instead of a number to represent the range of lines starting from the one on which the command is placed to the beginning or end of the dataset. Appending a / character requests all lines from the marked line Forward to the last line inclusive. Appending a \ character requests all lines from the marked line Backward to the top of the file inclusive.
For example, entering a D\ on line 3 would request deletion of lines 1 through 3. Entering a C/ on line 1 would select the entire file as the range to be used for whatever Primary command was entered.
Note: Be careful using the D line command with forward or backward modifiers. If you were to place D/ on line 1 of a file and press Enter, every line of the file will be deleted. There are no safeguards, and no "are you sure" messages to prevent you from doing this by accident. If you did issue a D/ on line 1 and didn't mean to, you can either (a) immediately issue an UNDO command, or (b) issue a CANCEL command to get out of the edit session without saving the (now zero-length) file. Bear in mind that if you issue a CANCEL command, you will lose all changes you have made to your file that were done after the last time the file was saved. Because the UNDO action may be more helpful than the CANCEL action, be sure you have issued set an appropriate UNDO levels in OPTIONS -> General to enable the UNDO command to work as you need it to.
The / and \ line command options can be used with the C, D, G, H, J, LC, M, O, OR, R, S, SC, TC, TG, TJ, TR, UC, and X
For R and TR line commands with / or \ modifiers, SPFLite converts these to an "equivalent block form" of RR and TRR, and has nothing to do with repetition factors or line lengths. See the R / RR - Repeat Lines and TR / TRR - Trim Trailing Blanks commands for more information.
The Pad to Length line command PL will accept a special modifier of / or \. When used in this way, a command of PL/ will pad all following lines to a minimum length of 1; PL\ will do the same to preceding lines. Placing PL/ on line 1 of a file can be used to ensure that all lines in the file have a minimum line length of 1; that is, it is a quick way to ensure there are no zero-length lines in the file. If you need to pad to a longer length (such as 4 for example), you can use the block mode version with PLL4 on line 1 and PLL on the last line.
See PL / PLL - Pad Lines for more information.
Note: Re: foreign keyboards. Since the / and \ characters are shifted characters on many keyboards, SPFLite will accept:
a period (.) in place or a /
a comma (,) in place of a \
two periods (..) in place of a \ to simplify typing.
Post-exclude and post-unexclude modifiers
The addition of one of + or - to a line command requests the lines specified by the command be excluded (-) or unexcluded (+) following the operation. For example, using CC- instead of CC for a copy operation requests the original lines being copied be excluded following the operation, just as if the range had been marked by XX line commands. If you used a regular CC block, and copied lines to an A- line, the original lines would not be excluded, but the new copies of those lines would be excluded.
(See also comments below about commands such as A&-).
The + and - line command options can be used with the A, AA, B, BB, C, CC, H, HH, LC, LCLC, LCC, O, OO, OR/ORR, R, RR, SC, SCSC, SCC, TC, TCTC, TCC, TG, TJ, UC, UCUC, UCC, (, ((, ), ))
Copy 3 lines after another and exclude the copied lines following the operation.
C3 AAA.....
000002 BBB.....
A- CCC.....
000004 DDD.....
would result in
000001 AAA.....
000002 BBB.....
000003 CCC.....
------ ----------------------- < 000003 > -------
000007 DDD.....
Copy a line and after keep the copy command for re-use.
C& AAA.....
000002 BBB.....
A CCC.....
000004 DDD.....
would result in
C& AAA.....
000002 BBB.....
000003 CCC.....
000004 AAA...
000005 DDD.....