Video mode 12H is a graphics mode, 640 pixels wide by 480 pixels deep. COBOL12 uses the graphics capability to display the various constructs which may be specified in this module, but the programmer is concerned only with the following screen format.
Screen locations and extents are specified in the usual form rrcc. There is one function which specifies the current cursor location, where ll is a row from 01 to 60, and cc is a column from 01 to 80. In all other functions, rrcc specifies the size of a construct, starting at the current cursor location, where ll is the number of rows and cc is the number of columns.
The functions which specify an area that is bounded by some form of border,
draw the border immediately outside the area. Such areas should therefore be
separated from other constructs by at least one column and row if the borders
are not to be overwritten.
DISPLAY FORMAT dataname
Dataname refers to an ascii string in the Data Division containing format functions and text. Each function in the string is a single CAPITAL letter, preceded by the character | to identify it, and followed by any operands required. The first character in dataname must therefore be the character |. The operands are shown below as lower case letters.
A common operand is shown as 'rrcc' as described above. It must always be four numeric characters. This is the same format used in the Screen Module.
Another common operand is 'text...' which represents a text string to be displayed as part of this function. All other data in the string are assumed to be text which is to be displayed at the current cursor location. This means that if there are errors in the data string - wrong or misplaced functions, etc - the data will be assumed to be text and will be displayed on the screen. This makes it relatively easy to identify errors in the format strings.
Note two special characters.
Demonstration Program
The program FMTDEMO.RUN is provided to demonstrate the various features
available in the Format Module, and the source program is also available, as
FMTDEMO.COB.
|NLine 1|NLine 2 ....
Note that if text is inserted on a line immediately above a button which has already been defined, the top of the button will be lost. To avoid it, define the text before the button.
M Mark (select) F Find E Erase (scissors) H Help C Copy Q Query I Insert (paste) X X (delete) U Up arrow S Save D Down arrow O Output (print) L Left arrow V View list R Right arrow W Full window T Tick G Get subform B Blank icon K Keep record (enter) A First of a vertical series a First of a horizontal series P Prior of a vertical series p Prior of a horizontal series N Next of a vertical series n Next of a horizontal series Z Last of a vertical series z Last of a horizontal series|IBx is a character icon where x represents an ascii character which is placed in the centre of the blank icon. A space must be left if a blank icon is required.
n: 1 = one OK button, at column 38 2 = Yes button at column 30 and a No button at column 46 3 = As above, and a Cancel button at column 38.The body contains up to four comment lines of 34 columns:
|N[Line 1]|N[Line 2]|N[Line 3]|N[Line 4]
Black text on the background attribute unless respecified. Lines may be omitted but the spacing is maintained by including '|N with no text. (The comment lines are at rows 25, 27, 29, 31.)
None (black) Red
Blue Tan (brown)
White Green
Light gray Yellow (light)
Dark gray Cyan (light)
Any of these colours may be used for foreground and background. These codes are also used in the SET - ATTRIBUTE statement of the Screen Module.
C Courier type ³ These two only cater for characters
F FixedSys type ³ 20H-7EH, normal keyboard characters.
D Dos standard Full 256 character set.
Fonts C and F provide only for characters 20h to 7Eh, the normal keyboard characters.
COLOURS
Video mode 12H provides 16 colours, of which ten are used by COBOL12. Three of
these colours have been altered, as follows.
Green A darker shade, sutiable for text.
Cyan Very light, suitable as a background.
Yellow Very light, suitable as a background.
These changes are effective only within the current COBOL program.
TYPE FONTS
Three type fonts are available:
Normal DOS font, whichever one is currently in use.
The two alternative fonts are:
A font based on Windows Courier, a thinner type set.
A font based on Windows FixedSys, a clean type set.
Both these sets are without serifs.
These alternative fonts contain only characters for Ascii 20h-7EH, the
characters on the normal keyboard. There are two exceptions however, for the
top left key on the normal keyboard:
The ~ character displays a filled circle
The ` character displays a tick.
SCREEN SAVING
The format routines save areas of the screen in a full 65k segment. This
provides enough space for 1024 screen characters of the 2400 on the screen, or
42.7% of the total screen. (One screen character requires 64 bytes in the
saved area.)
This should provide enough space for most requirements. For example, it can
contains an area of 42 columns by 24 lines (1008 bytes) or 64 columns by 15
lines (960 bytes). As a further example, the message box requires a save area
of only 360 bytes.
If an attempt is made to save a larger area, no error is noted and the end of
the saved data overwrites the start of the saved data.
Only one save area is available. Subsequent saves overwrite the previous
information.