>Consider the code below .... if you have an indexed cursor with buffering and you want use indexseek to search for the indexed value field you must issue a go top on the table before use of indexseek else even if your value exist on table, the indexseek will return .f. anyway, if you don't use buffering (buffering = 1) you will haven't problems!
>
>Someone have an explanation for this behavior ?? Is A Bug ?
>Thanx in Advance
>
>** Cut Here
>CREATE CURSOR pippo(codice char(5))
>INDEX ON codice TAG codice
>** With Buffering ie: 3/5 the behavior is different using no buffering (1)
>CURSORSETPROP('buffering', 5, 'pippo')
>
>APPEND BLANK IN Pippo
>REPLACE codice WITH 'CODE'
>
>
>ACTIVATE SCREEN
>CLEAR
>? 'Finding code --------------------------'
>? 'IndexSeek Move ', INDEXSEEK('CODE', .T., 'Pippo', 'codice')
>? 'IndexSeek NoMove ', INDEXSEEK('CODE', .F., 'Pippo', 'codice')
>? 'Seek ', SEEK('CODE', 'Pippo', 'codice')
>SEEK 'CODE' ORDER TAG codice IN Pippo
>? 'FOUND() ', FOUND('pippo')
>
>APPEND BLANK IN Pippo
>REPLACE codice WITH 'CODE22'
>GO TOP IN Pippo
>?
>?
>? 'Finding code2 using GO TOP --------------------------'
>? 'IndexSeek Move ', INDEXSEEK('CODE2', .T., 'Pippo', 'codice')
>? 'IndexSeek NoMove ', INDEXSEEK('CODE2', .F., 'Pippo', 'codice')
>? 'Seek ', SEEK('CODE2', 'Pippo', 'codice')
>SEEK 'CODE2' ORDER TAG codice IN Pippo
>? 'FOUND() ', FOUND('pippo')
>
>USE IN pippo
>** Cut Here
Emanuele,
It's known and intended behaviour, no bug. It's primary usage is to check for existence of key during a new record insertion. If it returned .t. for your newly inserted record then you'd be doing old workarounds to check. Once you move off the record indexseek would return .t. for the newly inserted record regardless of it was row or table buffered.
Cetin