TIP: Click on subject to list as thread! ANSI
echo: clipper
to: DIRK STUIJFZAND
from: ROLAND VAN WANROOY
date: 1996-11-18 21:51:00
subject: Re: READ time out

> About READ time out
> in message of Dirk Stuijfzand to All:
 Ahoi Dirk!
------------------------------------------------------------------------
 #define MAXWAIT     60        // define for maximum inkey wait time 
seconds)
 static slUpdated := FALSE     // updated flag
 // Standard modal READ on an array of GETs.
 function ReadModal( GetList )
    local get, pos, savedGetSysVars
    [...]
    begin sequence // <--- to satisfy BREAK in GetReader()
       while ( pos  0 )
       [...]
       end
       [...]
    end // sequence
    return ( slUpdated )
 procedure GetReader( get )
    local nMaxSecs := int( seconds()) + MAXWAIT
    // read the GET if the WHEN condition is satisfied
    if ( GetPreValidate(get) )
       get:SetFocus()  // activate the GET for reading
       while ( get:exitState == GE_NOEXIT )
          // check for initial typeout (no editable positions)
          if ( get:typeOut )
              get:exitState := GE_ENTER
          end
          while ( get:exitState == GE_NOEXIT )   // apply keystrokes until 
exit
  ///////////////////////////// MODIFICATION START
             i := inkey()
             // if no keystroke and maximum time has expired....
             if i == 0 .and. int( seconds()) > nMaxSecs
                // ...then pretend as if nothing happened...
                slUpdated := FALSE
                // ...and leave the get.
                break
             end
             GetApplyKey( get, i )
 //////////////////////////////// MODIFICATION END
          end // while ( get:exitState == GE_NOEXIT )
          // disallow exit if the VALID condition is not satisfied
          if ( !GetPostValidate(get) )
             get:exitState := GE_NOEXIT
          end
       end // while ( get:exitState == GE_NOEXIT )
       get:KillFocus()  // de-activate the GET
    end // if ( GetPreValidate(get) )
    return
------------------------------------------------------------------------
 roland.
 wanrooy@tref.nl
... Smile! You're on SDGN-BBS!  
--- Blue Wave v2.12
---------------
* Origin: HEKOM Holland. Clipper and CDGN Headquarters. (2:2802/223)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.