|
On Mon, 8 Aug 2005, Bob Voltz wrote:
This works, but....if they DO press Enter on the SecondScreen it throws an error.CPF0887 Data available from previous input request.
That's because you're requesting input from the screen (in spite of the fact that you don't want input) and then you never read it (clearly because you didn't want it in the first place)
You probably already know this, but I'll reiterate it to be clear: SNDF -- write data to screen RCVF -- Read data from screen (or another file) SNDRCVF WAIT(*YES) -- combines the above two commands. SNDRCVF WAIT(*NO) -- combines the above two commands, but does not wait for input. Will let the program continue while the user types, and you can wait for the input later by calling RCVF.In your particular example, you don't want to allow input on the 2nd screen... you just want to print a message and then let the program continue. That means you want to use SNDF (not SNDRCVF) since that doesn't allow input. You'll need to put FRCDTA on the record format to make sure it gets sent to the terminal right away.
For example: A DSPSIZ(24 80 *DS3) A R REC1 A 10 3'Type something:' A SOMETHING 30 B 10 19 A R REC2 A FRCDTAA 10 14'Processing something, please wait.-
A ..' A R REC3A 8 3'Done processing. Press ENTER to qu-
A it.' PGM DCLF FILE(TESTDSPF) /* get input from user */ SNDRCVF RCDFMT(REC1) /* show "please wait..." screen for 5 seconds */ SNDF RCDFMT(REC2) DLYJOB DLY(5) /* tell user it's done, press enter to end */ SNDRCVF RCDFMT(REC3) ENDPGM
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.