55 pts.
 How to restrict “Enter key’ on the AS/400 display file.
Is there any way to restrict the enter key on the display file like other function key. Ex If you did't configure F1 key the Display file If will not allow you to Access that key while doing the Exfmt.

Software/Hardware used:
ASKED: July 1, 2009  3:05 PM
UPDATED: July 3, 2009  2:39 PM

Answer Wiki:
Can you be more specific on why you would need the enter key restricted ? EXFMT = WRITE followed by a READ So if you do just a WRITE - you are basically displaying the record format without accepting any input. If the user presses any key, I suppose you could retrieve the status (Exception/Error Codes) from the INFDS to determine how you want to proceed next. I have not done this before, so not sure if this will work or not.
Last Wiki Answer Submitted:  July 1, 2009  3:53 pm  by  Satsho   1,245 pts.
All Answer Wiki Contributors:  Satsho   1,245 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Another option would be to use the attention indicator byte (pos. 369 – 369 (character) in the workstation INFDS) to determine the function key pressed. Enter is defined as x’F1′ – look for that and disallow any processing. This would let you keep other function keys on the screen active. You can even check for Auto-Enter, x’3F’

I like the attention indicator byte – I haven’t bothered attaching an indicator to a function key in ages. I just compare the field defined on the INFDS to pre-defined constants. You can find the definitions of the returned values here.

 5,670 pts.