senorbuckwheat
Programmer
Howdy,
Using the Btrieve API, I do a GET_EQUAL command on a Btrieve table. I set the OpCode, PosBlock, DataBufLen, KeyBuffer, and KeyNumber and then execute the command.
If a record is found that matches the key, I do some processing and then do a GET_NEXT to get the next record that matches the key and so on.
The problem is that the GET_NEXT gets records that does not match the key after all the records that match the key have been read.
It seems once it establishes a position in the file based on the key during the GET_EQUAL, it just keeps reading records sequentially using the GET_NEXT without regards to the key.
I work around it by checking the returned record values against key values after each GET_NEXT and then breaking when they do not match. But that seems to defeat the purpose of a GET_EQUAL,GET_NEXT using a key value.
Any suggestions would be welcomed.
Thank you.
Using the Btrieve API, I do a GET_EQUAL command on a Btrieve table. I set the OpCode, PosBlock, DataBufLen, KeyBuffer, and KeyNumber and then execute the command.
If a record is found that matches the key, I do some processing and then do a GET_NEXT to get the next record that matches the key and so on.
The problem is that the GET_NEXT gets records that does not match the key after all the records that match the key have been read.
It seems once it establishes a position in the file based on the key during the GET_EQUAL, it just keeps reading records sequentially using the GET_NEXT without regards to the key.
I work around it by checking the returned record values against key values after each GET_NEXT and then breaking when they do not match. But that seems to defeat the purpose of a GET_EQUAL,GET_NEXT using a key value.
Any suggestions would be welcomed.
Thank you.