|
|||||||
QTIPS - Time-outs in WindowsSerge Ciregna of Informataix recently asked if it was possible to display a window with an option for the user to take an action based on the window, and if no action had been taken in a fixed period of time, to automatically exit the window and return to the menu. The easiest way of achieving this is by modifying background indexing parameters on the fly to use a replacement index routine, and use the fact that this routine will be called after an elapsed amount of seconds to force the window to close after this time. E.G. 0001 Save = @Environ.Set 0002 @Index.Time = 5 ; * Set to the time to elapse 0003 /* 0004 Add two escapes into the data buffer (in case there is 0005 a "Changes Will Be Lost" message") 0006 */ 0007 @Environ.Set<77> = "C" 0008 @Environ.Set<78> = "@DATA=CHAR(27):CHAR(27)" 0009 call catalyst("W", "TEST") 0010 * Restore parameters 0011 Transfer Save to @Environ.Set 0012 @Index.Time = 30 0013 * And finally gobble up extra Esc if there 0014 Input X, -1 0015 If X = Char(27) Else @Data[1,0] = X (Volume 4, Issue 2, Page 4) |
|||||||
| |||||||