Repositioning after FIND fetches
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
Repositioning after FIND fetches
The AVM uses index cursors to keep track of what record
you last fetched. This is important if you use the FIND statement
to fetch a record. For example, depending on what was the last record fetched,
the following statement returns a different record:
|
If you had last fetched the first Customer record,
this statement would fetch the second Customer record. If you had
just fetched the fourth Customer record, this statement
would fetch the fifth Customer record.
A table can have multiple indexes, and the cursor position in
each index dictates what the next record is in that index. For example,
the following code fragment fetches Customers 1
and 21:
|
In the country–post index, the next record after Customer 1 is Customer 21. the AVM uses the index cursor to establish the correct context.
Sometimes cursor repositioning is tricky. For example, the following code fragment returns Customer 6 and Customer 7 (you might expect Customer 6 and Customer 2):
|
The first FIND statement causes the AVM to reposition
the CustNum index cursor to point to Customer 6. The second FIND statement
begins the search from that location, not from the beginning of
the CustNum index.