Multiple Sorts Without Using Multiple Function Keys

190 pts.
Tags:
RPG
RPGLE
Subfile
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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Burtmis
    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 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following