Problem solve Get help with specific problems with your technologies, process and projects.

Working with the Auto Refresh functionality

I tried to use the Auto Refresh functionality by using two display files, unfortunately, I am not able to make this work. Can you please provide me with an example on how to go about implementing this functionality?
I know about using ONE display file, and whether with one display file or with two, the requirements are as follows:

1. The INVITE keyword must be on the main format (the format you would normally use EXFMT to write/read in your program).

2. The parameter WAITRCD(n) must be specified on the CRTDSPF command. "n" is the number of seconds to wait before control is returned to the program. Also specify RSTDSP(*YES) and MAXDEV(1). You can use OVRDSPF before opening the display file to change the value of "n."

3. The KNUM keyword must be specified on the F-spec for the WORKSTN file in your RPG program, with a value of 1 (RPG), or MAXDEV(*FILE) (RPGLE).

4. Instead of EXFMT, you use WRITE to the FORMAT name, and READ from the DISPLAY FILE name. The READ should have resulting indicators specified at the Lo and Eq positions (RPG), or the E extender (RPGLE).

5. After the READ, check the *STATUS field from the display file information data structure (RPG) or %STATUS (RPGLE). If the value is 01331, then the WAIT time expired and control returned. If it is NOT 01331, then the user caused control to return by pressing a function key.

Now this should work. If it does not, go to Search400.com's discussions and search for "waitrcd." That search will get you lots of advice and some good examples of actual code.


The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on iSeries programming commands