| Introduction | MTB Statements | File System | Compiler | Applications | Reference Guide | Index |
| Language Structure | Data Division | I/O Format Division | Procedure Division | Mnemonics |
| Overview | FORMAT statement | Format objects | Video formatting | Printer formatting |
| Overview | Video Control Codes
|
Video control codes are used within FORMAT statements to set various modes for video devices (terminals, monitors). These modes include display modes, input modes, and other characteristics for the video device.
Initially, the video device will placed in a specific display mode, using one of the following control codes: (Screen), (CPL132), (CPL64), (CPL80), or (DE).
Next, the video device will be placed in typewriter mode or normal mode. In typewriter mode, the screen display scrolls from bottom to top. In normal mode, the screen is used in a non-scrolling fashion. The (ET) and (EN) control codes are used to place the screen in typewriter mode or normal mode, respectively.
Another display characteristic is foreground mode versus background mode. In foreground mode, data is displayed in normal video (usually light characters on a dark background), while background mode shows the data in inverse video (usually dark characters on a light background). The (SF) control code is used to "start foreground," while the (SB) control is used to "start background."
By design, all data entry areas on the video screen are foreground areas. It follows that non-data entry areas are not foreground (i.e., they are background or "suppressed background"). Since the data entry cursor will only land in a foreground area, data entry screen formats can be designed with a combination of background prompts and foreground data entry areas.
Suppressed background is a special type of background. It may contain special formatting symbols, such as transmit marks and right justify marks, or may contain blank spaces. In the latter case, the blank spaces may not be considered as data entry areas since they are not in foreground mode.
Comet's terminal protocol uses block data transmission. This means that data entered from the keyboard of an terminal or other video device is buffered in terminal until a specified point. Then, the entire block is transferred to the terminal adapter board (and the CPU). This method results in a more efficient input/output of terminal data.
MTB uses transmit marks to define the size of the input buffer. A transmit mark character is placed at the beginning of the data entry area, and another transmit mark is placed on the screen following the final field to be included in the input buffer. You may use transmit marks around individual fields, or you may include many fields within two transmit marks. In either case, the data entered between the two transmit marks will not be transmitted from the terminal until the cursor passes over the second transmit mark (by using the Enter, Tab, or Return key).
The (TM) control code is used to place a transmit mark at a given point on the video screen. An alternative transmit mark, the transmit stop mark, may also be used. The control code for a transmit stop mark is (TP).
MTB also provides a control code to protect data entry in numeric fields. The (RJ) code establishes a right justified field, where only numeric values and a minus sign are allowed to be entered (other characters are not accepted from the keyboard). The (RJ) control is placed immediately before a numeric data entry field. One (RJ) mark must be used for each numeric data entry field.
Transmit marks and right justify marks appear in suppressed background (as "invisible" characters) or, for debugging purposes, can be configured to show on any PC monitor screen.
MTB provides several general purpose control codes, including (CS) for clearing the entire screen, (CF) for clearing only the foreground areas of the screen, and (CFLD) for clearing a single data entry field.
The (BF) control code provides a simple way to fill an entire line with blanks.
Cursor control is also provided through MTB's video control codes. The (CH) control moves the cursor to the "home" position (i.e., the upper left corner of the screen or the first available foreground position from the upper left). The (CR) control provides a "cursor return" feature to move the cursor to the beginning of the next line. The (MC) control is used to remember the cursor's position, and the (RC) is used to restore the cursor to its remembered position.
You may also place the cursor at any foreground screen location by specifying a position directive. Consider the following example:
100This example uses a cursor positioning directive to move the cursor to column 10, row 15. If this location is a foreground area, the cursor will reside at 10, 15, otherwise it will move to the right and the down, looking for the first available foreground position.@(10,15) . . . PRINT (0,100)
Some of MTB's special purpose control codes include:
Many of the video control codes can be positioned at a specific location on the video screen. There are two ways to do this. The first way is to include a positioning statement with the control code itself, as follows:
(control-code),@(column,row)Notice that a comma separates the parameters in the above example.
The second way to position a control code at a specific screen location is to use two controls. The first control code will be the screen location, and the second will be the desired control code, as follows:
@(column,row);(control-code)Notice that the two controls are separated with a semicolon in this example.
Individual programming style dictates which method may be used, so be aware of this when reviewing source code written by another programmer.
(SINGLEKEYTRANSMIT)Using the imbedded blank feature, this mnemonic could also be written as:
(SINGLE KEY TRANSMIT)Furthermore, using the upper/lower case feature described above, this mnemonic could be written as:
(Single Key Transmit)This feature is available in Comet 504 and greater.