Basic Edit Functions
Contents of Article
There are a variety of basic interactions available to alter your edit file.
You may modify text by using the arrow keys to move within the data, and type over or insert text as desired. The Insert key will toggle Insert / Overtype mode as needed. (The current status is always visible as INS or OVR in the Status Bar) You can control the size of the cursor in normal mode and in Insert mode and whether it blinks. See Options - Screen for customization options. If automatic colorization support is active, the display line is not re-colorized to match the entered text until the next "attention" key is pressed (Enter, command key, etc.)
If the Keyboard Option "KB Starts in INSERT mode" is checked, the keyboard will be in INSERT mode when SPFLite is started. Note that editing in Insert mode is typical for Windows-based editors, while editing in Overwrite mode is how the mainframe 3270-based ISPF operates. Even with the many word-processing enhancements available in SPFLite, most users will find it more practical to operate SPFLite in Overwrite mode most of the time, rather than starting off in Insert mode.
You may sometimes see "Overwrite mode" described as "Overtype mode" in the documentation. They both mean the same thing.
If HEX mode is selected (see the HEX command), then data may also be edited in Hex, which can be used to enter characters which are not normally available via the keyboard. Note that if you use Hex mode to insert/alter control characters such as CR and LF, you must do so carefully. Hex mode is sensitive to the file's SOURCE encoding. If editing an EBCDIC file, for example, the hex characters entered must be the EBCDIC values, such as X'F1' for EBCDIC '1' rather than X'31' for ANSI '1'.
If you want to enter special characters but don't want to use HEX mode to enter them, you can place them into the clipboard using the (CharSet) popup and then paste them into your file. See the (CharSet) keyboard function in Keyboard Primitives more information.
Primary commands are entered on the Command line at the top of the screen. They typically affect multiple lines in the file being edited. Multiple commands may be entered at one time on the command line, separated by a command separator character. As in ISPF, the default for this character is the ; semicolon, but this can be altered in the Options - General options window. When the character assigned as the command separator is enclosed in quotes, it is treated as ordinary data.
If the command line is prefixed with an & character, then the command line will be retained in place following command execution rather than being cleared. This allows you to perform the command again by just pressing Enter.
Primary commands are used for many purposes:
- Scroll to a specific line number or Line Label.
- Find a specific line that contains (or does not contain) a search string
- Find and change a character string
- Save the edited data or cancel without saving
- Create or replace other files than the one being edited
- Sort data
- Delete lines
- Undo changes made, subject to the number of maintained Undo levels (see SETUNDO for more details)
- Initiate parallel editing of lines in Power Typing Mode
- Submit jobs for execution using an external process
- Execute external programs using CMD
You can now use the LINE primary command to apply line-mode or block-mode line commands to a range of lines.
When a file has been modified since it was initially loaded, or since the last SAVE command, this will be indicated on the file tab by the color of the file name itself. See Options - Screen for choosing these colors. You can choose colors that will best convey the status of each file. For example, you could choose to display modified files with red letters for the file tab, and blue letters for unmodified files, with a light background for each. Then, when you see a file tab in red, you would know the file is modified.
Note: It is up to you to select colors that will work for you to achieve this affect. At installation time, the default color scheme will not do that, but will require user modification. You may need to experiment to find good color choices.
There is a second file modification indicator - the word Edit in the lower-left corner of the screen on the status line. In unmodified files, you will just see Edit, while in modified files, you will see Edit *.
In Multi-Edit mode, the modification indicator display is more complex. See Working with Multi-Edit Sessions for more information.
If a command entered on the Command line is not recognized by SPFLite as one of the built-in commands, before deciding that a command is invalid, SPFLite will first check to see if the entered command is a user-defined command macro. A command macro is script file with an extension of .MACRO stored in the \SPFLite\MACROS data folder. If such a file (e.g. cmdname.MACRO) exists, then SPFLite will execute the script file. Further details on using command macros is provided in Command Macro Support.
Because of this search order, a user-defined command macro cannot have the same name as a built-in primary command. You could save a command macro file with a primary command name, like FIND.MACRO, but SPFLite would never use it. (This was a design trade-off, for performance reasons).
Command macros should not be confused with keyboard macros, which is a completely different feature. See Keyboard Customization and Keyboard Macros for more information.
Line commands affect single lines or block of lines. You enter line commands by typing them in the Line Command field on one or more lines and then pressing Enter. The line command field is represented by a column of 6-digit numbers on the far left side of your display. When you are entering data into new temporary blank lines created by the I line command, the line command field contains 6 quotes. This field is also used to display special lines, such as the ==CHG> flag, which indicates a line which has been altered by a primary CHANGE command. You can use line commands to:
- Insert or delete lines
- Repeat lines
- Rearrange lines or overlay portions of lines
- Split lines apart and join lines together
- Perform text paragraph entry and formatting
- Shift data
- Include or exclude lines from the display
- Control tabs and boundaries for editing
- Alter the text case (upper-case, lower-case, sentence-case and title-case)
When text is entered on the command line, and a command key is pressed rather than the ENTER key, SPFLite concatenates the contents of the command line to the definition of the command key. The result is handled as a single, composite command by SPFLite. (A "command key" is a key mapped to a primary command.)
For comparison purposes, in IBM ISPF, a 3270 Enter key or PF key would be treated as a "command key", while data keys, cursor keys and PA keys would not be. 3270 data and cursor keys do not initiate a 3270 data transmission, but the Enter and PF keys do. A PA key like PA1 only transmits the fact that the PA key itself was pressed, but doesn't send any other data; it's like an "interrupt" key. "Command keys" in SPFLite use a similar concept to the 3270 Enter and PF keys.
For example, when you use a Command key defined as a scroll command (UP, DOWN, LEFT, or RIGHT), the value entered on the command line becomes the operand of the scroll command. Assume you have the PageDn key mapped to the DOWN primary command. Entering H or HALF on the command line and then pressing the PageDn key results in a composite command of DOWN HALF being issued to scroll the screen down by half its height.
You may choose to override this concatenation when you set up the command key definition by preceding the command with a ! (exclamation mark character). This causes the programmed command to replace whatever is in the command line. e.g. If you have a key programmed for RESET, it would probably be wise to prefix it with a ! to prevent the RESET command processor being confused by possible command line 'remnants' existing when the command key is pressed.
Created with the Personal Edition of HelpNDoc: Easily create Help documents