while
Code: Select all
SET BROWSESYNC ON
when using GRID with ROWSOURCE for DBF it will change Property "Recno" ( NOT "Value" )
Code: Select all
#IFDEF Use_Browse
nRecNo := GetProperty( "XPPTEL", "Browse_1", "value")
#ELSE
nRecNo := GetProperty( "XPPTEL", "Browse_1", "RecNo")
#ENDIF
Code: Select all
GOTO(nRecNo)
---
i try to use a Thread to check if "Recno" have change while ONCHANGE does not react
Code: Select all
hb_threadStart( HB_THREAD_INHERIT_PUBLIC, @Wait4Action() )
Code: Select all
PROCEDURE Wait4Action()
LOCAL nRecNo := 1
STATIC xOld := 0
DO WHILE lRunning = .T.
IF USED()
IF IsControlDefined ("Browse_1", "XPPTEL")
#IFDEF Use_Browse
nRecNo := GetProperty( "XPPTEL", "Browse_1", "value")
#ELSE
nRecNo := GetProperty( "XPPTEL", "Browse_1", "RecNo")
#ENDIF
IF xOld <> nRecNo
xOld := nRecNo
GOTO(nRecNo)
XPPTEL_Store()
ENDIF
ENDIF
ENDIF
DO EVENTS
hb_idleSleep( 1 )
ENDDO
RETURN

so i use a TIMER
Code: Select all
DEFINE TIMER internal_timer_2 INTERVAL 100 ACTION Wait4Action()
Code: Select all
PROCEDURE Wait4Action()
LOCAL nRecNo := 1
STATIC xOld := 0
IF USED()
IF IsControlDefined ("Browse_1", "XPPTEL")
#IFDEF Use_Browse
nRecNo := GetProperty( "XPPTEL", "Browse_1", "value")
#ELSE
nRecNo := GetProperty( "XPPTEL", "Browse_1", "RecNo")
#ENDIF
IF xOld <> nRecNo
xOld := nRecNo
GOTO(nRecNo)
XPPTEL_Store()
ENDIF
ENDIF
ENDIF
DO EVENTS
RETURN
Question : why is Thread not working here
