AS400 Mid Range/rpg help

Advertisement


Question
QUESTION: 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?

Answer
You 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

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Concise Systems/Laird Scranton

Expertise

General AS/400, RPG/400, SDA and CL programming questions. AS/400 performance tuning.

Experience


Past/Present clients
CB Sportswear
Coca-Cola of New York
Encore Paper Company
Golub Corporation
HBO Home Video
Imperial Pools
Kaiser Permanente of NE New York
Mallinckrodt Medical
Marigold Foods
Manpower & Associates
National Datacomputers
New York State Easter Seals Society
New York State Food Merchants Association
Pepsi-Cola Allied Bottlers
Petricca Construction
Taconic Telephone Corporation
TOMRA Recycling
Unistress Corporation

©2012 About.com, a part of The New York Times Company. All rights reserved.