home *** CD-ROM | disk | FTP | other *** search
- // GetGoTo.prg
- //
- // Get reader implementing GOTO GET
-
- #include "GetExit.ch"
-
- MEMVAR GetList
-
- proc GetMoveReader( oGet )
-
- LOCAL nCurrentGet
-
- nCurrentGet := Ascan(GetList, {|o| o == oGet })
- IF !(GetMovingTo() == NIL) .AND. nCurrentGet != GetMovingTo()
- IF nCurrentGet > GetMovingTo()
- oGet:exitState := GE_UP
- ELSE
- oGet:exitState := GE_DOWN
- ENDIF
- ELSE
- GetMovingTo(NIL)
- // 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 )
- GetApplyKey(oGet, InKey(0))
- 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
- ENDIF
-
- RETURN
-
-
- FUNCTION GoToGet(n)
-
- LOCAL oGetCurrent := GetActive()
- LOCAL nGetCurrent := Ascan(GetList, {|o| o == oGetCurrent})
-
- IF nGetCurrent > n
- oGetCurrent:exitState := GE_UP
- ELSE
- oGetCurrent:exitState := GE_DOWN
- ENDIF
- GetMovingTo(n)
-
- RETURN NIL
-
-
- FUNCTION GetMovingTo(n)
-
- STATIC nWhereToGo
- LOCAL nOldWhereGo := nWhereToGo
-
- IF Pcount() > 0
- nWhereToGo := n
- ENDIF
-
- RETURN nOldWhereGo
-