• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 551
  • Last Modified:

How to handle the Automatic screen advance in RPG program

When the record format is displayed on the screen, I want the format to wait for sometine for the user response and then go in the loop to check some condition and again display the format. Before displaying the screen once again We will check for some status in the file and act accordingly.
0
aprashup
Asked:
aprashup
  • 2
  • 2
2 Solutions
 
Gary PattersonVP Technology / Senior Consultant Commented:
0
 
tliottaCommented:
Gary:

I read the question as more basic than that. It seemed to me that the question was more like "How do I display a screen, receive input from the user, process the input, and then redisplay the screen for the next input?"

It might simply be that a description of the EXFMT op-code in a loop would be sufficient.

Or auto-refresh might also be the answer. Clarification might be needed.

Tom
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
Tom,

Good point.  I considered that possibility until I saw that aprashup rated himself as "advanced" on this topic.  I probably should have covered both eventualities for completeness sake.

I read the desired flow as:

1) Display record on screen
2) Wait for input from user or until some predefined timeout period occurrs
3) Return control to the program.
4) Check conditions and file status and loop to step 1.

"When the record format is displayed on the screen, I want the format to wait for sometine [sic] for the user response and then go in the loop to check some condition and again display the format. Before displaying the screen once again We will check for some status in the file and act accordingly.

I inferred that "wait for sometime" indicated a timeout.

aprashup,

Tom is correct, if you just need the format to stay on the screen indefinitely until the user presses Enter, you just use EXFMT in a loop.  It will wait forever for the user to take action.

If you need to wait for the user to take action, OR for a timeout interval to expire, then the data queue technique described in the link above is a perfect solution.

- Gary Patterson

0
 
tliottaCommented:
Gary:

Yeah, "sometime" seems like a good interpretation. Not sure why, but it got in my head as "something". Probably just because of the "n".

A few links, and then I'll leave:

Basic IBM pseudo-code:
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.langref2.doc/explq.html

A couple examples:
http://www.mcpressonline.com/tips-techniques/rpg/techtalk-using-data-queues-for-automatic-screen-painting.html
http://search400.techtarget.com/tip/1,289483,sid3_gci855472,00.html

Gary knows everything needed for data queues and how they can relate to display files; so he can cover any confusion.

Tom
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now