> 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)
|