home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / rexxintuition_463.lzh / RexxIntuition / TimeOut.rexx < prev   
OS/2 REXX Batch file  |  1991-03-09  |  976b  |  32 lines

  1. /* An example of using the dissidents rx_intui.library TIMEOUT feature */
  2.  
  3. wind=GetWindow('Time Out',,,,640,75,,,)
  4. IF wind == '' | wind == 0 THEN SAY 'Window open error'
  5.  
  6. /* Let's ask for a TIMEOUT of 1 sec */
  7. err=SetTime(wind,10)
  8.  
  9. /* Loop until CLOSEWINDOW. Print # of timeouts. Note that every 2 seconds */
  10. /* a new timeout total appears. Also, note that if the user makes this    */
  11. /* window inactive, then the updates stop. This is because we didn't ask  */
  12. /* to receive INACTIVEWINDOW and ACTIVEWINDOW, and set and clear NO_SLEEP */
  13. /* when receiving each respectively. */
  14. class = 1
  15. time = 1
  16. DO WHILE class > 0
  17. spec=WaitMsg(wind)
  18. PARSE var spec class part1 part2 part3
  19.  
  20. /* Only do this part if a timeout event */
  21. IF class = 10 THEN DO
  22. /* When we get up to 20 timeouts, disable the feature */
  23. IF time == 20 THEN err=SetTime(wind,)
  24. /* Increment the # of timeouts and print the value */
  25. err=Text('# of timeouts = 'time,wind,5,40)
  26. time=time+1
  27. END
  28.  
  29. END
  30.  
  31. err=EndWindow(wind)
  32.