I'm just doing some cleanup on HMG4 GRID/BROWSE code and as I said in the previous message I found some problems. So I'm looking at HMG3 source code to better understand what happens and your problem is an excuse to do so
mol wrote:
for changing pointer in GRID/BROWSE I use this code:
Code: Select all
if lGridControlMode
SetProperty(cOkno,"B_Towary","RECNO", towary->(Recno()))
else
//lBrowseControlMode
SetProperty(cOkno,"B_Towary","Value", towary->(Recno()))
endif
What's wrong with me or GRID???
It seems to me that SetProperty(cOkno,"B_Towary","RECNO", towary->(Recno())) ends in h_grid.prg function setdatagridrecno()
Can you please check which branch of the IF is taken ?
The first branch is taken if:
- there is no filter
- SET DELETED is OFF
- there is no FOR in the index (but there other options that should probably checked, like UNIQUE)
then ordkeyno() is used to retrieve the "line" of the row.
otherwise gotop() and loop until the correct recno() is found()
So you should check how the index is built, its parameters.
If still in error, I'd unroll SetProperty(cOkno,"B_Towary","RECNO", towary->(Recno()))... I mean creating a function that extrapolates the program lines from SetProperty functions and create a MySetDataGridRecno() that "overloads" the standard one, and putting trace info to understand what happens...