Don, You should at least optimize the code by just checking a counter and not messing with TIME(). Your NAP command automatically takes care of the amount of time spent in each loop. You just need to count how many NAPs it takes to equal the amount of wait time you wish to have.
David A. Green (480) 813-1725 DAG Consulting -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Don Robinson Sent: Tuesday, March 27, 2012 11:07 AM To: U2 Users List Subject: Re: [U2] Detecting idle time in INPUT statement. Thanks to all who responded. At the point in the programs where this is a problem for us, we know the user has a lock, we just want to release the lock. This will be done where they already have the option of aborting so no problem with partial updates, etc. The only gotcha on this is if they type one character, the INPUTIF will wait forever on the Enter key but this isn't too likely. The following code does this pretty well. * Don Robinson * Testing the INPUTIF statement. * PROMPT '' * ZZ = '' TIME.OUT.TIME = INT(TIME()) + 10 ;* Wait 10 seconds. LOOP INPUTIF ZZ THEN EXIT NAP 100 IF INT(TIME()) > TIME.OUT.TIME THEN CRT 'The user is sleeping....' STOP ;* Do whatever you want here. END REPEAT * * User entered something, proceed as usual. * CRT CRT 'User entered: ': ZZ * STOP END Regards, Don Robinson From: Wjhonson <wjhon...@aol.com> To: u2-users@listserver.u2ug.org Sent: Tuesday, March 27, 2012 1:53 PM Subject: Re: [U2] Detecting idle time in INPUT statement. Right, you don't care if they are at input exactly. You care if they are squatting on a lock. So your periodic lock checker thingie, has to be combined with a nasty email-o-gram campaign Until the users are well edumacated. -----Original Message----- From: George Gallen <ggal...@wyanokegroup.com> To: U2 Users List <u2-users@listserver.u2ug.org> Sent: Tue, Mar 27, 2012 10:44 am Subject: Re: [U2] Detecting idle time in INPUT statement. I guess you would need to merge this with the routine to detect who has locks pen (except running every two mins, not five) To determine who is sitting at an input prompt at a menu (which might be ok), s someone who is sitting at an input Prompt and hogging the locks! George -----Original Message----- rom: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] n Behalf Of Wjhonson ent: Tuesday, March 27, 2012 12:18 PM o: donr_w...@yahoo.com; u2-users@listserver.u2ug.org ubject: Re: [U2] Detecting idle time in INPUT statement. Timed* activity on a *line* is controlled by the O/S not within Universe per e. Or at least you shouldn't expect Universe to keep you informed when lines re idle, natively. So (being on AIX a type of Unix) you are going to need to write a onstantly-running background task which queries the last modified timestamp on he lines and reports on idle lines. This is something controlled in AIX you now. Not just the timestamps but the timeout conditions. But *acting* on these in an automatic fashion would be quite dangerous to the ntegrity of your database, I'm sure you know. his should be used for informational purposes only. You get your reports, itch at the users involved, and gradually they learn to stop doing it. That's the best approach, IMHO, having lived through this exact scenario in many ompanies. ----Original Message----- rom: Don Robinson <donr_w...@yahoo.com> o: U2 listserver <u2-users@listserver.u2ug.org> ent: Tue, Mar 27, 2012 6:26 am ubject: [U2] Detecting idle time in INPUT statement. ello all, e are running Universe 10.1 on AIX with about 500 users. We have a problem with ers opening up a record which puts a lock on it and just letting it sit at the PUT statement for a long time. ost of the locking within the application does not use the LOCKED clause so en a second person needs the locked record, their session waits. hat is the best way to detect the user hasn't typed anything for a period of me, say 2 minutes? This needs to be simple as we have no desire to rewrite the plication! IRC, some other MV systems have a timeout on the INPUT but I can't find ything about this in the UV manual. hanks, on Robinson _____________________________________________ -Users mailing list -us...@listserver.u2ug.org tp://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ 2-Users mailing list 2-us...@listserver.u2ug.org ttp://listserver.u2ug.org/mailman/listinfo/u2-users ______________________________________________ 2-Users mailing list 2-us...@listserver.u2ug.org ttp://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users