Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a way to set a timer for a display file

Status
Not open for further replies.

tyone

MIS
Feb 27, 2004
22
US
I have a rpgle program and want to make it easier for the end users so they don't have to hit return to end the display. The format of the displays are all records. The first one asks for employee number. it then will either answer with a yesno display, but i want the yesno displays to automatically end after like 2 to 5 seconds.
thanks in advance.

 
tyone,

Instead of doing a EXFMT just do a WRITE of the record format then call a CLP that has a DLYJOB for the number of minutes you want. That should do the trick. When control returns to your RPGLE then just end the program.

HTH,
MdnghtPgmr
 
where and when do i do the read to display. is it done in the clp and is it done before or after the dlyjob
 
You would READ the record format in question. This is in the RPG. I guess I don't really understand what you are trying to do.

MdnghtPgmr
 
MdnghtPgmr,
the display sits there until u press enter by default. What i want to do is have the display show for 3 to 5 seconds and then end as if u have hit the enter key.
 
Right. You are probably using a EXFMT, right? Change it to a WRITE, call the CLP with the DLYJOB, and then when control returns from the CLP do whatever you want. You can READ the format or whatever you need to do.

HTH,
MdnghtPgmr
 
ok i write the record i call the clp with a dlyjob. at this point my display has not shown up. if u do either a read or exfmt the display will sit until the the user presses the enter key. i understand that this is by default but i don't want my user to have to press the enter key. i want the display to think that the enter key as been hit after a few seconds.
 
Another way of doing this is with the ER (automatic record advance). I still don't quite understand. Are the users keying data? I see problems. User A wants to see the screen for 3 minutes and user B wants to see the screen for 5 minutes and user C wants to see the screen for 10 minutes. What are you tring to do?

MdnghtPgmr
 
MdnghtPgmr email me at djmajr@hotmail.com

it is just to show the employees if they have punched in or not. no the only keying in is done on the intial screen. that screen has to wait until the user hits enter. the other two screens only say
john smith u are punched in and what time he punched in
or john smith u are not punched in at this time
where is ER (automatic record advance) at is that a keyfield in the dds that u set.
 
Are you using SDA? Or are you manually editing the source with SEU?

If you are using SDA, put an astrick (*) in front of the field and press enter. Then put a 'Y' in the option "Keying options" and press enter. On the screen you will see and option called, "Automatic record advance". Put a 'Y' in there and press enter. Now when the user keys there id number and presses field exit the system will act as if they also keyed the enter key.

If you are using SEU, after the field (next line in the source) key CHECK(ER).

That's it! Recompile the display and the RPG and you should be set.

HTH,
MdnghtPgmr
 
The best way to have this achieved (a timer) is exactly the usage of the INVITE DDS keyword on the format you want your users to wait for the required time in seconds.
I explain this.
Say you want your FMT1 format in display file INVDSP to automatically end after 5 seconds.
- Add the INVITE kwd in your DDS DSPF and compile it with WAITRCD(5)(or whatever) or use later a OVRDBF or CHGDSPF command.
When compiling the display file, a value for WAITRCD must be specified. This value represents the amount of time the display waits for input. If no input is received in the time specified, control returns to the RPG program.
The DLYJOB command would halt the program and not wait.

- In the RPGLE program to show you what happens, try this
...
C Write FMT1 88
C 'Time elapsed' Dsply
...
the program will continue sequentially and automatically behind the write stm, users don't have to hit return when the required time is elapsed.
This is a genuine timer method.
HTH
 
ok i have added the invite kwd in the dds dspf and have set the waitrcd to 5 it still doesn't end. it has sat there since before lunch time. after i made the change to the dds i did recompile the rpg program also.
 
the program will wait 5 seconds on the write and then will do what you tell it to do after the write stm. Pls show me a snippet of your program and the associated dds . I've just made a test here and it works like a charm.
 
ok i see what u are saying now..... damn hit me up along side the head with a bat... thanks for all of your help and time.

don
 
Hey - don't know about RPG IV/400, etc but in RPG II you can output a format name of $$TIME with the amount of time to wait before automatically returning to the program.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top