MIKESEDITFE and format effectors
The EDITFE edit file is provided to enable format effectors to be included in COBOL program data definitions. Instead of a FILLER... VALUE nnn clause, a data definition is written as !aa [nn] where aa is the mnemonic for the format effector and nn is the numeric qualifier if one is required (e.g. horizontal and vertical positions).
CLS | Clear screen |
STPRF | Start protected flashing |
STPR | Start protected |
STUNF | Start unprotected flashing |
STUN | Start unprotected |
BELL | Bell |
NL | Newline |
MSP n | Multiple space n = number > zero |
MNL n | Multiple newline n = number > zero |
VP n | Vertical position n = number, 0 - 24 |
HP n | Horizontal position n = number, 0 - 79 |
SOM | Set SOM |
CURSOR | Leave cursor at current position (use at end of message) |
The CURSOR command is superfluous, as the cursor is placed wherever the last positional format effector leaves it.
Example
01 HELLO-SCREEN. 03 !CLS. 03 !STPR. 03 !VP 5. 03 !HP 35. 03 FILLER PIC X(11) VALUE IS "Hello world". 03 !MNL 4. 03 !HP 50. 03 FILLER PIC X(10) VALUE IS "Q to quit". 03 !STUN. 03 !MSP 1. 03 !STPR. 03 !HP 61.
which would clear the screen, set it to protected, and at line 6 column 36 (going from 1, 1 as the line and column origin) output "Hello world" followed by 4 new lines, and at column 51 a 1 byte unprotected field, placing the SOM at the start of this field and leaving the cursor there.
I have written a somewhat clumsier version of the edit file for SCL. In this, the mnemonics are simply translated directly into their hex equivalents, so numeric values also have to be given as hex. The above example would be rendered by
HELLO_SCREEN := HEX(!CLS!STPR!VP5!HP35) + "Hello world" HELLO_SCREEN := HELLO_SCREEN + HEX(!MNL04!HP32) + "Q to quit" HELLO_SCREEN := HELLO_SCREEN + HEX(!STUN!MSP01!STPR!HP3D)