Marc's Place

 

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
© 1997- Marc Vos (and others)   -   Privacy Statement   -    Contact Me

On this website, Google Analytics is used to track visitor statistics. These are anonymised data about the number of visitors, which pages they visit on this site, from which regions they visit, which web browsers they use, etc.. You will also see non-personalised ads via Google AdSense. Cookies from Paddle or Paypal are placed when you click on a 'Buy now!' or 'Donate!' button, and possible cookies from Disqus when you use that system to comment on one or more blogposts.
Privacy Statement