FN_E$CUR - Retrieve cursor position
Inclusion in RPG source
- I /COPY E$LIB/SRC(ILE),DS_E$PGM
. . .
. . .
C /COPY E$LIB/SRC(ILE),FN_E$CUR
Invocation
- EXSR E$CUR
Input Parameters
- ##CURS (b1)
- Field in the DEVICE data structure which contains a binary representation of the cursor when the display file returns data to the program.
Output Parameters
- ##ROW (s3)
- Hidden field on a record-format in a DSPF which will contain the row number of the screen the cursor was on.
- ##COL (s3)
- Hidden field on a record-format in a DSPF which will contain the column number of the screen the cursor was on.
What it does
- Converts the binary value in ##CURS into two separate values for ##ROW and ##COL, which can be used to locate where on the screen the cursor was when a function key was pressed. Those two fields can also be used to position the cursor on the screen, by filling them with a valid row and column number prior to executing the EXFMT statement.
Examples
-
* After user pressed F4 C EXSR E$CUR * C SELEC C ##ROW WHEQ 4 * C SELEC C ##COL WHGE 10 C ##COL ANDLE20 C EXSR SUBR1 C ##COL WHGE 25 C ##COL ANDLE35 C EXSR SUBR2 C ##COL WHGE 40 C ##COL ANDLE50 C EXSR SUBR3 C ENDSL * C ##ROW WHEQ 8 C ##COL ANDGE10 C ##COL ANDLE16 C EXSR SUBR4 C ENDSL *
Go to download page