In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

QTIPS - Time-outs in Windows

Serge 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)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel