Hi Roger
I want to skip to the next unigue record in a non-unigue table. I am using ADSDBE and I tried using AdsSkipUnique( hIndex, 1 ) API but didn't work.
Thanks
Joseph
I need DBSKIPUNIQUE() Function
Re: I need DBSKIPUNIQUE() Function
Code: Select all
FUNCTION dbSkipUnique( n )
LOCAL xValue, cLastChar, cSeek, xNewValue
IF n > 0
xValue := &(IndexKey(0))
cLastChar := SubStr(xValue,LEN(xValue))
cSeek := SubStr(xValue,1,LEN(xValue)-1)+Chr(Asc(cLastChar)+1)
dbSeek(cSeek,.t.)
ELSE
xValue := &(IndexKey(0))
dbSkip(-1)
xNewValue := &(IndexKey(0))
IF xNewValue == xValue .AND. !Bof()
dbSeek(xNewValue)
dbSkip(-1)
ENDIF
ENDIF
RETURN nil
The eXpress train is coming - and it has more cars.