Move the current row to a new position by moving it forward or backward by a specific number of rows. Can be used to loop through the rows in a cursor.
- The named cursor in which the current row is to be moved.
- The number of lines by which to move the current row. A positive number moves the current position forward; a negative number moves the current position backward (providing the cursor was not opened as forward-only).
If the move was successful the return value is nDelta. If the move would place the current row beyond the end of the cursor the return value is 0 and the current row is the last (or first, if moving backward) in the cursor.
The UpdateCursorItem method must be called in order for the return type to acknowledge the end of the cursor when changes to cursor items have been undertaken. Otherwise the return will always be nDelta.
Available: GEO D OD OM SISpy
Dim Count As Integer=-1
Count = Count + 1
Loop Until sis.MoveCursor ("MyCursor", 1) = 0
sis.MoveCursor ("MyCursor", -Count)
This code counts how many rows there are in MyCursor between the one current initially and the end of the cursor. It does this by moving the current row forward and then moves the current row back to be the one current initially.