entered as the Up or Down key is selected (example below)
Presumably while I just press the UP or DOWN arrow it's still in focus and the VALID clause isn't getting called.
Calling it via ON UP and ON DOWN just prevents the Spinner from working
Thanks
Peter
- Code: Select all Expand view RUN
- #Include "FiveWin.Ch"
Function Main()
Local oDlg
Local oGet1
LOCAL oGet2
LOCAL nStart := 0
LOCAL nEnd := 0
USE CUSTOMER NEW SHARE
DEFINE DIALOG oDlg FROM 100,100 TO 400,400 PIXEL
@ 2,1 GET oGet1 VAR nStart PICT "99" SPINNER VALID Selected(nStart,nEnd)
@ 2,10 GET oGet2 VAR nEnd PICT "99" SPINNER VALID Selected(nStart,nEnd)
ACTIVATE DIALOG oDlg
return nil
FUNCTION Selected(nStart,nEnd)
LOCAL nSelected := 0
DBGOTOP()
DO WHILE ! EOF()
IF nStart <= CUSTOMER->AGE .AND. nEnd >= CUSTOMER->AGE
nSelected++
ENDIF
DBSKIP()
ENDDO
@ 14,15 SAY STR(nSelected)+" selected"
RETURN .T.