0 pts.
 DDS / RPG – cursor management
RPG
My question is regarding cursor management. My application displays list of members (using RPG and DSPF). There is one input field per row, in which the user enteres the option he wishes to preform on the selected row. The RPG processes the selected row, by the given option. My question is: When the RPG completes its process on the selected row - I re-display the screen. How can I place the cursor exactly on the input field in the row which the user selected before he hit 'ENTER'. In other words, The user want to perform option number 2, and then option number 3 on the same row. I want him the have the cursor on the same row he started to work with when option 2 completes. Currently, my cursor is placed on the input field of the FIRST row on the screen. I tried many suggestions. None helped. thanks

Software/Hardware used:
ASKED: November 9, 2005  9:44 AM
UPDATED: November 19, 2009  3:34 PM

Answer Wiki:
You can try this...hope it works! 1. Set a hidden field (flag) that you set on when option 2 is selected on that subfile record. Try using this flag to possition cursor the next time the subfile is displayed. or 2. Re display the subfile positioning on the subfile record that was selected. When the subfile is re-displayed then the prior selected record will be the first record. bye
Last Wiki Answer Submitted:  November 10, 2005  4:35 pm  by  TSTOKES   0 pts.
All Answer Wiki Contributors:  TSTOKES   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

You didn’t tell us what you tried; only that what you tried didn’t work. That means we have to guess if you already tried what we might suggest.

How do you remove the option that the user entered from the option field? Bo you rewrite the subfile? Or do you issue an UPDATE to the subfile RRN to blank out just that one subfile option field?

Tom

 107,995 pts.

 

Updating the subfile record with display attribute Position cursor in effect. If you have updated multiple records with this indicator active the cursor will be positioned on the first subfile record that has the display attribute in effect.

 2,250 pts.

 

For your problem, this’ll work if the records displayed don’t change (1st stays 1st, 2nd stays 2nd) from when the Enter key is pressed to when the records are redisplayed.

On the SFLCTL record format, include this:

                          CSRLOC(ROW        COLUMN)
                          RTNCSRLOC(&FORMAT &FIELD)
ROW            3S 0H                               
COLUMN         3S 0H

In the RPG include this:

FDisplay   Cf   e             Workstn                     
F                                     sfile(subfile: rrna)
F                                     infds(workstn)      
D Workstn         Ds                 
D  dspfilnm         *file            
D  dsprcdnm         *record          
D  function             369    369   
D  cursor               370    371b 0
Csr   cursor        Div       256           row   
Csr                 Mvr                     column

(I’m pulling this from an older program – don’t bust my chops for not using /Free).

If you want the cursor to assume the default position (first input-capable field on the format), simply clear row and column.

This isn’t limited to subfiles & has the advantage of not requiring any indicators.

 5,670 pts.