Switch to: V12V11V10V9V8V7V6V5

VCursor Class: Navigation Methods

VCursor.FirstRecord()

Declaration:

FirstRecord() as Boolean	

Description:

Go to the first logical record of a Cursor.

  • Returns TRUE if the first record is found.
  • Returns FALSE if the cursor is empty.

Example:

res = curs.FirstRecord()

VCursor.LastRecord()

Declaration:

LastRecord() as Boolean	

Description:

Go to the last record of a Cursor.

  • Returns TRUE if the last record is found.
  • Returns FALSE if the cursor is empty.

Example:

res = curs.LastRecord()

VCursor.PrevRecord()

Declaration:

PrevRecord() as Boolean					

Description:

Go to the previous record of a Cursor if it exists.

  • Returns TRUE if the previous record was found (i.e. the current position was changed).
  • Returns FALSE if the current record was the first already or the Cursor is empty.

Example:

res = curs.PrevRecord()

VCursor.NextRecord()

NextRecord() as Boolean

Description:

Go to the next logical record of a Cursor if it exists.

  • Returns TRUE if the next record was found (i.e. the current position was changed).
  • Returns FALSE if the current record was the last already or the Cursor is empty.

Example:

if( myCursor.FirstRecord() )
	Do
		// work here 
	Loop	Until myCursor.NextRecord() = FALSE
end if 

Example:

You can also do this with the Position property in conjunction with RecordCount, but the NextRecord() is more efficient.

if( myCursor.RecordCount > 0 )
	myCursor.Position = 1
	For i = 1 to myCursor.RecordCount  // work here 
		myCursor.Position = myCursor.Position + 1
	Next
end if