home *** CD-ROM | disk | FTP | other *** search
- /***
- * Gets11.prg
- *
- * Get reader implementing during clause
- */
-
- #include "Getexit.ch"
-
-
- #command @ <row>, <col> GET <var> ;
- [<clauses,...>] ;
- DURING <b> EVERY <n> ;
- [<moreClauses,...>] ;
- ;
- => @ <row>, <col> GET <var> ;
- [<clauses>] ;
- SEND reader := {|oGet| ;
- GetDuring(oGet, <{b}>, <n>) } ;
- [<moreClauses>]
-
- MEMVAR GetList
-
- FUNCTION Gets11
-
- LOCAL cVar1 := Space(10), ;
- cVar2 := Space(15), ;
- cVar3 := Space(12)
-
- CLEAR SCREEN
- @ 10, 10 SAY "Enter cVar1" GET cVar1
- @ 11, 10 SAY "Enter cVar2" GET cVar2
- @ 12, 10 SAY "Enter cVar3" GET cVar3 DURING t() EVERY 1
-
- READ
-
- RETURN NIL
-
-
- proc GetDuring( oGet, bDuring, nTimeout )
-
- LOCAL nKey
-
- // read the GET if the WHEN condition is satisfied
- IF ( GetPreValidate(oGet) )
- // activate the GET for reading
- oGet:SetFocus()
-
- DO WHILE ( oGet:exitState == GE_NOEXIT )
- // check for initial typeout (no editable positions)
- IF ( oGet:typeOut )
- oGet:exitState := GE_ENTER
- ENDIF
-
- // apply keystrokes until exit
- DO WHILE ( oGet:exitState == GE_NOEXIT )
- IF (nKey := InKey(nTimeOut)) != 0
- GetApplyKey(oGet, nKey)
- ELSE
- Eval(bDuring, oGet)
- ENDIF
- ENDDO
-
- // disallow exit if the VALID condition is not satisfied
- IF ( !GetPostValidate(oGet) )
- oGet:exitState := GE_NOEXIT
- ENDIF
- ENDDO
-
- // de-activate the GET
- oGet:KillFocus()
- ENDIF
-
- RETURN
-
-
- FUNCTION T()
-
- LOCAL nSr := Row(), ;
- nSc := Col()
-
- @ 0, 0 SAY Time()
- @ nsr, nsc SAY ""
-
- RETURN NIL