Use and validate Function Key on Display File/RPG ILE

15 pts.
Tags:
RPGILE
Hi Everyone, My program uses a display file and I want to use a function key (say F4) to prompt for, let's say customer name field, at row 10, column 20. How do I do this on the display file and how do I check to make sure F4 was pressed and valid only when the cursor was at customer name field in my RPG program? Thank you for your help. Lap Nguyen

Answer Wiki

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

Enable F4, and an associated indicator such as *in04, with the DDS keywords CF04(04) or CA04(04). If *in04 is on after the exfmt or read to the record format then they pressed F4. For determining what field the cursor was in you can use the DDS keyword RTNCSRLOC. This keyword has an option which will return, in a field of you choosing, the name of the field on the display where the cursor was located. F4 will be enabled anywhere on the display, but you can verify with RTNCSRLOC that the cursor was in the customer name field and, if not, your program can return an error message.

Discuss This Question:  

 
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

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