165 pts.
 Multiple Sorts Without Using Multiple Function Keys
When doing WRKACTJOB, you can put the cursor over the column you wish to sort and then press F16. I have a subfile program with multiple sorts and presently the user has to press different function keys to sort. Can anyone give me an example of the code to use so my program will act like that in WRKACTJOB? My users do not want to have to press the different function keys to sort.

Software/Hardware used:
ASKED: February 12, 2008  2:10 AM
UPDATED: February 12, 2008  3:41 PM

Answer Wiki:
The DDS keyword RTNCSRLOC has the option to return to your program the field (including subfile fields) that the cursor is in when a function key is pressed. You can test this field to determine what column your user wants to sort on. One item to watch out for -- the subfile column headings in a subfile control record are often constants rather than fields. If the user asks for sorting when the cursor is in a constant then the field name returned is blank (which makes sense as the cursor isn't in field). You can then either prompt them to put the cursor in a "valid" place or test the actual location of the cursor yourself. Alternatively, you can make the column headings a field to simplify processing.
Last Wiki Answer Submitted:  February 12, 2008  10:43 am  by  bvining   6,055 pts.
All Answer Wiki Contributors:  bvining   6,055 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

I use SQLRPGLE to sort my subfiles. I give the users one command key to press and once there they can sort by one or more colums that I have set up. It probaly would not be any problem to use cursor location instead of a sort screen. It you are interested in the coding let me know.

 100 pts.