AS400 Mid Range/rpg help
Expert: Concise Systems/Laird Scranton - 10/11/2007
QuestionQUESTION: I need the control to go back into the program without the user hitting the enter key or Function key. In my application I want to get something displayed in one of the fields of the same screen when the user enters something on the first screen field. He should not hit enter key or the function key, the moment he enters something on the first field i have to verify it and then display the data corresponding to it in the other field. I have to make the system sense that first field is filled. Is it possible? I tried field exit check but then control never comes back unless i hit enter key
ANSWER: Try using the CHECK(RA)keyword. It functions as if the ENTER key was pressed when the final character of the field is keyed. (If you are auto right-adjusting the field, you will have to press FIELD EXIT after keying the field.
- Laird
---------- FOLLOW-UP ----------
QUESTION: Thanks for your reply. If I am not wrong then you want me to use CHECK(ER) automatic record advance. But then the problem is that I cant distinguish between an enter key hit and field exit key hit. I am looking for way to distinguish both these events so that I can do something different on both the events.For both the events FE key hot an enter key hit; same AID byte is returned X'F1'. Why is it so? Isn't there a separate AID byte for Field exit key?
AnswerYou could assign the CHANGE keyword to the field with an indicator. The indicator comes on if the contents of the field have been changed. When control returns to your program, if the indicator is off, then the user pressed ENTER. If it is on, they entered data in the field.
- Laird