15 pts.
 Use and validate Function Key on Display File/RPG ILE
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

Software/Hardware used:
ASKED: February 22, 2008  11:27 PM
UPDATED: February 23, 2008  3:01 AM

Answer Wiki:
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.
Last Wiki Answer Submitted:  February 23, 2008  3:01 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:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _