tips:revmedia:v4i2a1

QTIPS - Time-outs in Windows

Published ByDateVersionKnowledge LevelKeywords
Sprezzatura Ltd01 JUN 19922.12+EXPERT@ENVIRON.SET, TIME-OUTS, @INDEX.TIME

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.

   Save = @Environ.Set
   @Index.Time = 5 ; * Set to the time to elapse
   /*
       Add two escapes into the data buffer (in case there is
       a "Changes Will Be Lost" message")
   */
   @Environ.Set<77> = "C"
   @Environ.Set<78> = "@DATA=CHAR(27):CHAR(27)"
   call catalyst("W", "TEST")
   * Restore parameters
   Transfer Save to @Environ.Set
   @Index.Time = 30
   * And finally gobble up extra Esc if there
   Input X, -1
   If X = Char(27) Else @Data[1,0] = X

(Volume 4, Issue 2, Page 4)

  • tips/revmedia/v4i2a1.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1