Returns a table of values defining the character values required by the run-time system screen output routines to correctly display given line drawing characters.
call "CBL_GET_SCR_LINE_DRAW" using function-code line-draw-table returning status-code
Using call prototype (see Library Routines - Key) | Picture (32-bit systems) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
function-code | cblt-x1-compx | pic x comp-x. | |||||||||||
Contains one of the following:
| |||||||||||||
line-draw-table | Group predefined as containing: | Group containing: | |||||||||||
With function-code = 0: | |||||||||||||
cblte-gsld-draw-code | cblt-x1-compx | pic x comp-x. | |||||||||||
cblte-gsld-draw-char | cblte-gsld-draw-char occurs 256 times | pic x occurs 256 times. | |||||||||||
With function-code = 1: | |||||||||||||
cblte-gsld-draw-code | cblt-x1-compx | pic x comp-x. | |||||||||||
cblte-gsld-dbcs-draw-char | cblte-gsld-dbcs-draw-char occurs 256 times | pic x(2) occurs 256 times. | |||||||||||
With function-code = 2: | |||||||||||||
cblte-gsld-draw-code | cblt-x1-compx | pic x comp-x. | |||||||||||
cblte-gsld-draw-char | cblte-gsld-draw-char | pic x. | |||||||||||
With function-code = 3: | |||||||||||||
cblte-gsld-draw-code | cblt-x1-compx | pic x comp-x. | |||||||||||
cblte-gsld-dbcs-draw-char | cblte-gsld-dbcs-draw-char | pic x(2). | |||||||||||
status-code | See Library Routines - Key |
With function-code = 2 or 3: | |
cblte-gsld-draw-code | The offset (shape description) of the character required. |
cblte-gsld-draw-code | Byte filled in by the run-time system to determine any mapping that has taken
place in the table as follows:
For bits 0 through 2, line types are mapped to the first available of single, double, extended or ASCII character. | ||||||||
With function-code = 0: | |||||||||
cblte-gsld-draw-char | The single-byte line drawing table. Bytes in the table are arranged as follows:
| ||||||||
With function-code = 1: | |||||||||
cblte-gsld-dbcs-draw-char | The double-byte line drawing table. Bytes in the table are arranged as follows:
| ||||||||
With function-code = 2: | |||||||||
cblte-gsld-draw-char | The requested single single-byte line drawing code. | ||||||||
With function-code = 3: | |||||||||
cblte-gsld-dbcs-draw-char | The requested single double-byte line drawing code. |
When requesting a single line drawing character (function-code = 2 or 3), the cblte-gsld-draw-code parameter is used to tell the run-time system which character you require. The cblte-gsld-draw-code parameter for a given cblte-gsld-drawing shape can be calculated by splitting a byte into four bit-pairs. Each bit-pair defines the type of line that you want to appear in one of the four directions:
Bits | Direction |
7 and 6 | North |
5 and 4 | South |
3 and 2 | West |
1 and 0 | East |
Each bit-pair can have one of the following values:
00 | In the given direction, there is no line |
01 | There is a single-thickness line |
10 | There is a double-thickness line |
11 | There is an extended-type line. |
The extended line type is available only for systems which have additional types of line drawing, such as dotted lines. If a system has more than one additional type, only one can be used at a time.
For example, if you wished to find out the screen handler's character code for a line which would define the bottom-left of a box with single thickness sides and a double thickness bottom, you would make the following calculations:
Bit-pairs:
North: | 01 (single) |
South: | 00 (blank) |
West: | 00 (blank) |
East: | 10 (double) |
This gives the binary value of 01000010 or a decimal value of 66. Therefore, you would move 66 to cblte-gsld-draw-code before calling CBL_GET_SCR_LINE_DRAW in order to obtain the correct character for this shape.
If you use function-code = 0 or 1 to obtain the full line drawing table, a given character can be located in the table using the bit-pair algorithm described above, which yields a numeric value for a given shape. However, by default, COBOL subscripts begin at one, not zero. Therefore, if you use the following construct to obtain the full line drawing table:
03 cblte-gsld-draw-char pic x occurs 256 times.
you need to add 1 to the result of the bit-pair algorithm to locate the correct character (and, therefore, need a subscript which is larger than one byte).
However, you can use the following construct to obtain the table:
With function-code = 0:
03 filler pic x. 03 cblte-gsld-draw-char pic x occurs 255 times.
With function-code = 1:
03 filler pic x(2). 03 cblte-gsld-dbcs-draw-char pic x(2) occurs 255 times.
You must ensure that the NOBOUND Compiler directive is set to enable you to use subscripts 0 to 255, which map directly onto the result from the bit-pair algorithm.