|
Hm, I think there's way to do this without having a data queue: http://archive.midrange.com/rpg400-l/200212/msg00021.html Here's the thread that contained the example code you posted from Scott: http://archive.midrange.com/rpg400-l/199911/msg00382.html He says the DTAQ is more flexible. Charles > -----Original Message----- > From: Dan Bale [mailto:dbale@xxxxxxxxxxxxx] > Sent: Thursday, October 07, 2004 10:03 AM > To: RPG programming on the AS400 / iSeries > Subject: RE: How to unlock a record in an interactive job after 'x' > amount oftime has passed > > > Yes, there is a way. Unfortunately, I burned so much time > dealing with a > Midrange-L thread on CPYF this morning that I can't spend > time looking up > the specifics. > > Did you try searching the RPG400-L archives for "display time > out". Since > the search in the archives is fairly weak on search terms, > you may have > better luck using Google and site:midrange.com. > > You're in luck. I just remembered I had an example app > provided by none > other than Scott Klement a few years back. You may be able > to glean what > you need from this: > > DSPF TIMEOUTD: > A DSPSIZ(24 80 *DS3) > A R SCREEN1 > A INVITE > A FRCDTA > A 9 17'There is a > timeout on this- > A screen. Press ENTER' > A 10 27'or wait for it > to time out.' > A MSG 50 O 14 16 > > RPGLE TIMEOUTR: > fTimeOutD cf e Workstn UsrOpn > > d RunCmd pr ExtPgm('QCMDEXC') > d Cmd 200a Const > d Len 15p 5 Const > > d RcvDtaQ pr ExtPgm('QRCVDTAQ') > d dqname 10a Const > d dqLib 10a Const > d dqLen 5p 0 > d dqData 80a > d dqWait 5p 0 Const > > d DQLen s 5p 0 > d TimeOut s 5p 0 > d DQData s 80a > > c* create a data queue in QTEMP. > c Callp RunCmd('CRTDTAQ DTAQ(QTEMP/TESTDQ) - > c MAXLEN(80) SEQ(*FIFO)': 200) > > c* Make the display file use the new data queue > c Callp RunCmd('OVRDSPF FILE(TIMEOUTD) DTAQ(' + > c 'QTEMP/TESTDQ)': 200) > > c* open the display file. > c Open TimeOutD > > c* Show the screen the user. This format has the > c* "FRCDTA" keyword so the screen will show up immediately, and the > c* "INVITE" keyword so the keyboard isn't locked. > c Write Screen1 > > c* Wait for one of two conditions... > c* 1) an entry to appear on the data queue or > c* 2) A timeout while waiting for the data queue. > c Eval DQLen = 80 > c Eval Timeout = 10 > c Callp RcvDtaQ('TESTDQ':'QTEMP': DQLen: DQData: > c Timeout) > > c* Show the results... (if Len=0, no data was received...) > c If dqLen = 0 > c Eval Msg = 'TIMEOUT! Press ENTER to quit.' > c Else > c Read SCREEN1 99 > c Eval Msg = 'ENTER! Press ENTER > again to quit' > c Endif > c Write SCREEN1 > > c* Wait "forever" for enter to be pressed, this time. > c* (Timeout=-1 means that it'll never timeout) > c Eval Timeout = -1 > c Callp RcvDtaQ('TESTDQ':'QTEMP': DQLen: DQData: > c Timeout) > c Read SCREEN1 99 > > c* Do some cleanup and end... > c Close TimeOutD > c Callp RunCmd('DLTOVR FILE(TIMEOUTD)':200) > c Callp RunCmd('DLTDTAQ DTAQ(QTEMP/TESTDQ)':200) > c Eval *inLR = *On > > hth, > db > > > -----Original Message----- > > From: rpg400-l-bounces.com@xxxxxxxxxxxx / Andy Hautamaki > > Sent: Thursday, October 07, 2004 9:45 AM > > > > Is there a way from a RPGLE interactive program to track > how long it has a > > record locked in update and after a certain amount of time > has elapsed, > > gracefully unlock the record. Then the interactive program > would show some > > info message to inform the User that they will need to retrieve the > > transaction again. > > > > Thanks > > Andy > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) > mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. >
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.