This routine returns the numeric values indicating the current line and column positions of the cursor. The top-left corner of the screen is assumed to be the origin (where the line and column numbers are 0).
Specification
01 text-cursor-position. 02 line-position PIC 9(4) BINARY. 02 column-position PIC 9(4) BINARY. 01 status-code PIC S9(4) COMP-5.
CALL "CBL_GET_CSR_POS" USING text-cursor-position RETURNING status-code.
Interface
Specifies the area to store the line position of the text cursor.
Specifies the area to store the column position of the text cursor.
Return code
The return code is set in the status-code specified in the RETURNING clause.
0: Successful
Other than 0: Failure
Note
Note the following points when using CBL_GET_CSR_POS:
If the text cursor is not found on the screen, 255 is set in the line and column parameters.
If the specified cursor position exceeds the size of the screen, this routine will fail.