|
As others have pointed out, RTNCSRLOC is probably the best way to go. However, you asked about returning row and column to allow you to figure out which field you're in. Doing this required you to hard-code row/column coordinates to translate position to name, which is clunky and can cause problems if the screen ever changes. Much beter to use the alternate form of RTNCSRLOC, which returns cursor position by format name, field name, and position in the field.... Here's a little sample I used once to try out mousable screens, that uses cursor location. A DSPSIZ(24 80 *DS3) A INDARA A R TEST2 A CF03(03) A CF13(13) A CF14(14) A CF15(15) A CF16(16) A RTNCSRLOC(*RECNAME &$CURREC &$CURFL- A D &$CURPOS) A MOUBTN(*ULD CF13) A MOUBTN(*ULP CF14) A MOUBTN(*URD CF15) A MOUBTN(*URP CF16) A $CURREC 10A H A $CURFLD 10A H A $CURPOS 4S 0H A 1 2DATE A EDTCDE(Y) A 2 2TIME A 8 21'Event:' A EVENT 14 O 8 29 A 9 21'Button:' A LASTFLD 10 O 9 29 A* A $FNCHANGE 8A O 12 29DSPATR(RI) A DFTVAL(' Change ') A COLOR(BLU) A $FNCANCEL 8A O 12 39DSPATR(RI) A DFTVAL(' Cancel ') A COLOR(BLU) A 31 $FNNEXT 10A O 12 49DSPATR(RI) A DFTVAL(' Next ->> ') A COLOR(BLU) FTestMouse2CF E Workstn F IndDS($DspInd) *File Indicator Data-Structure - Interface for INDARA D $DspInd DS D* Function Keys Controls D $F03 3 3N Inz(*Off) D $F13 13 13N Inz(*Off) D $F14 14 14N Inz(*Off) D $F15 15 15N Inz(*Off) D $F16 16 16N Inz(*Off) D $ShowNext 31 31N Inz(*Off) C ExFmt Test2 C C Select C When $F03 C Seton LR C Return C C When $CurFld = '$FNCANCEL' C Eval LastFld = $CurFld C Eval $ShowNext = *Off C C When $CurFld = '$FNCHANGE' C Eval LastFld = $CurFld C Eval $ShowNext = not $ShowNext C C When $CurFld = '$FNNEXT' C Eval LastFld = $CurFld C EndSl C C Select C When $F13 C Eval event = 'L Dbl Clk' C When $F14 C Eval event = 'L Sng Clk' C When $F15 C Eval event = 'R Dbl Clk' C When $F16 C Eval event = 'R Sng Clk' C EndSl Eric DeLong Sally Beauty Company MIS-Project Manager (BSG) 940-297-2863 or ext. 1863 -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Luqman Sent: Friday, December 16, 2005 8:33 AM To: rpg400-l@xxxxxxxxxxxx Subject: Knowing cursor position (row,column) of Screen ? How can I know, which row/column the cursor is ? I want to retrieve the current field name on which the cursor is, so that I can display list of that field. For example: I have one record format with 02 fields, supplier and location, if cursor is on supplier field and user press F4, supplier list should be appear, if cursor is on location field, and user press F4, the location list should be appeard. Best Regards, Luqman
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.