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.
Visual Basic |
---|
Public Function MoveCursor( _ ByVal cursor As String, _ ByVal nDelta As Long _ ) As Long |
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 MM ME MD OD OM SISpy
Group:
Dim Count As Integer=-1
Do
Count = Count + 1
Loop Until sis.MoveCursor ("MyCursor", 1) = 0
sis.MoveCursor ("MyCursor", -Count)
This code counts, by moving the current row forward, how many rows there are in MyCursor between the one current initially and the end of the cursor. It then moves the current row back to be the one current initially.
Send comments on this topic.
Click to return to www.cadcorp.com
© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).