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
0: Request for single-byte line drawing table
1: Request for double-byte line drawing table
2: Request for a single single-byte line drawing code
3: Request for a single double-byte line drawing code
01 cblt-get-scr-line-draw-buffer typedef.
03 cblte-gsld-draw-code cblt-x1-compx. *> pic x comp-x.
03 cblte-gsld-dbcs-draw-char cblt-x2-compx. *> various pic x(2) Occurs n times
03 cblte-gsld-draw-char
redefines cblte-gsld-dbcs-draw-char cblt-x1-compx. *> Occurs n times
| bit 7 - 3 | Reserved (set to 0) |
| bit 2 | Extended lines not supported - mapped |
| bit 1 | Double lines not supported - mapped |
| bit 0 | Single lines not supported - mapped |
| bits 6 and 7 | The North line. |
| bits 4 and 5 | The South line |
| bits 2 and 3 | The West line |
| bits 0 and 1 | The East line |
| bits 6 and 7 | The North line. |
| bits 4 and 5 | The South line |
| bits 2 and 3 | The West line |
| bits 0 and 1 | The East line |
Comments:
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:
Each bit-pair can have one of the following values:
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:
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:
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:
With function-code = 1:
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.