Display file screen delay in RPG ILE

2880 pts.
Tags:
AS/400
RPG ILE
RPGLE
Hi all! I have a RPGLE program and have used a main screen and a window in it. The main screen SCR01 will have all the filed to update a record. When I press F2 the record will update as usual after that the small window will be shown which is having "Record Updated Successfully!"  words. No problem about this. Now I wanted to show the small window only for some 2 or 3 seconds then close automatically and program will continue executing the following lines. As it can be achieved in CL Program(DELAY), how can I do that in RPGLE without calling a CL? Surey.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Surey, you can accomplish this in RPG by compiling your display file with the option of DEV(*NONE). Then, in your RPG program, specify MAXDEV(*FILE) in the F spec for the display file. In the C specs for this display, you must issue a separate write and read instead of EXFMT. On the READ instruction, specify the (E) extension i.e. READ(E).   Immediately following this statement, you can test the %ERROR function and if it is true your display has “timed out” and control returns to your RPG program.  Prior to running this RPG you must have in your leading CL program or on a command line, the OVRDSPF instruction with WAITRCD(3). This means that you are giving it 3 seconds to “time out”.  Of course, you can specify any number of seconds that you want.  F and C spec examples are below.

FMID008    CF   E             WORKSTN MAXDEV(*FILE)

.

.

C                   WRITE     MAIN1                                        FORMAT                
C                   READ(E)   MID008                                                       
C                   IF        %ERROR                                       SCREEN TIMED OUT
C                   ITER                                                                   
C                   ENDIF                                                                  

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    What does you code look like that is displaying the message window? Is it waiting on an input of some type (EXFMT command)?
    132,690 pointsBadges:
    report
  • IseriesMike
    Surey, the C spec code got a little whacked when I posted.  The WRITE instruction is writing a format called MAIN1.  The TIMED OUT wording is simply the end of the prior line and is part of a comment.  Also, if you want avoid CL altogether, you can simply compile the display file with a WAITRCD time that you want.
    30 pointsBadges:
    report
  • Sureyz
    Thanks for your detailed explanation IseriesMike.
    2,880 pointsBadges:
    report
  • ToddN2000
    Nice little trick ISeriesMike. Will add that one to my list. It's an alternative when the screen get too full and there is no space for a normal message. This would allow a multi line message.
    132,690 pointsBadges:
    report
  • TheRealRaven
    I don't quite get the problem. A "window" seems very inappropriate for this even with a "2 or 3 seconds" delay. That would get irritating after the first time it showed up, causing a slowdown in the process. Why have it disappear automatically? An <Enter> would still be used to get past the window in a hurry before a time-out, and the window wouldn't even be seen in a touch-type data entry situation. A message-line message seems much better.
    35,070 pointsBadges:
    report
  • Sureyz
    The idea behind is just close to close the main screen after the display of the window message. message line cant do this. because i placed a leave command immediately after the window screen. So main screen itself will close. Yes it can be processed with an <Enter> key still its a event should be occurred. As a programmer I dont want my user to do some more works for a small entry.


    Surey 
    2,880 pointsBadges:
    report
  • TheRealRaven
    message line cant do this.

    Sure it can. That's how *COMP messages are intended to be used in this situation. The actual call stack structure needs to be described to us in order to know what parm values are appropriate.
    35,070 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: