>I hope this is a case of too much turkey over the holidays. I think i found a bug with Table Buffering. If i have a cursor with buffering set to 5(table) and change a value of an indexed field, then try to seek on the field i just changed, SEEK returns true (which it should not since the value no longer exists in the table) and the record pointer is left on the next record in the index order. I tested the following program in both VFP5.0a and VPF6.0 and got the same results. PLEASE somebody tell me i am crazy or i am doing something totally wrong.
>
>Thanks
>
>Geno Prida
>geno_prida@watsonwyatt.com
>
>
>** SAMPLE CODE **
>CLOSE DATA ALL
>
>CLEAR
>SET MULTILOCKS ON
>SET SAFETY OFF
>
>CREATE DATA IndexBug
>CREATE TABLE Tbl1 ( field1 i )
>INDEX ON field1 TAG field1
>
>FOR x = 1 to 9
> INSERT INTO Tbl1 VALUE(x)
>NEXT x
>
>CURSORSETPROP("Buffering", 5)
>
>lRetVal = SEEK(7, "Tbl1", "Field1")
>IF lRetVal THEN
> ? "Found 7 at recno ", RECNO()
>ENDIF
>
>? "Change value to 0..."
>REPLACE Field1 WITH 0
>
>lRetVal = SEEK(7, "Tbl1", "Field1")
>IF lRetVal THEN
> ? "Found 7 again! at recno ", RECNO()
>ELSE
> ?
> ? "It worked"
>ENDIF
>
>** END SAMPLE CODE **
I have never come against this problem so I am going to guess that seek is against the physical data not the buffered data.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only