Benjamin
Freshman Member
Looking forward to a year of creative output and discovery.
Posts: 22
|
!END
Dec 15, 2023 15:13:44 GMT -5
Post by Benjamin on Dec 15, 2023 15:13:44 GMT -5
The keybinding for F3 has the primary command '!END'. I understand what the 'END' command does, but what is the '!' do?
|
|
|
!END
Dec 15, 2023 15:30:08 GMT -5
Post by Robert on Dec 15, 2023 15:30:08 GMT -5
It's a consequence of how SPFLite handles keyboard input. There was a time when, if there was any leftover command on the primary command line, and you pressed a PF key, the mapping of that key was added to whatever was there, and the result was a big mess.
For instance, suppose you typed FIND ABC on the command line, but before pressing Enter, you decided to quit the edit session by pressing F3. What you would get would be, first,
END FIND ABC
and then you'd get the error, Excessive operands for the END command
What the ! does is that it first erases the primary command field, and THEN puts whatever the F key has mapped to it, which is "END" in this case. Net result is, you can press F3 and know it will always END the session, even if you were in a hurry and didn't want to bother clearing the command line.
R
|
|
|
!END
Dec 15, 2023 15:35:20 GMT -5
Post by George on Dec 15, 2023 15:35:20 GMT -5
The ! in front of any key binding indicates that any existing command line contents are to be ignored. Commands from keybinding (like PgUp/PgDn) will automatically add the existing command line as an operand to the key binding.
e.g. Type MAX or M on the command line and hit PgDn. SPFLite will see DOWN MAX and do a Max scroll down.
But if there is some data on the command line from a prior incomplete command, then your END command could end up as END gobbledeygook and trigger an error message from END regarding an unknown operand.
The ! lets YOU decide whether to allow this add-on of operands to occur.
George
|
|
Benjamin
Freshman Member
Looking forward to a year of creative output and discovery.
Posts: 22
|
!END
Dec 15, 2023 16:05:02 GMT -5
Post by Benjamin on Dec 15, 2023 16:05:02 GMT -5
Robert, George, thanks!
Benjamin
|
|
|
!END
Dec 19, 2023 5:30:48 GMT -5
Post by Stefan on Dec 19, 2023 5:30:48 GMT -5
Benjamin,
When you use KEYMAP to assign a command string to a keyboard key, the ! character before the command is essentially the equivalent of (Home)(EraseEOL) primitives.
So by adding the '!' before the comamnd, you're telling SPFLite to a) MOVE the cursor to the command line AND b) ERASE the content (if any) on the command line BEFORE entering whatever follows the ! character on the now-empty command line.
|
|