Name: revMoveToRecord

Type: command

Syntax: revMoveToRecord <recordSetId>, <recordNumber> 

Summary: Moves to the specified record in a record set (database cursor).

Introduced: 3.5

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Security: disk,network

Example:
revMoveToRecord tCursor, the menuHistory of button "Record Number"

Example:
revMoveToRecord tCursor, tCurrentRecord + kRecordsPerPage

Parameters:
recordSetId: The number returned by the revQueryDatabase function when the record set was created.
recordNumber: The zero-based index of the record to move to (i.e. the first record is 0, the second is 1)

The result: Not all databases support moving directly to a specified record in a record set, however for those that do, it will typically be faster to use the <revMoveToRecord> command than to repeatedly call <revMoveToNextRecord> or <revMoveToPreviousRecord>. If the database does not support the operation, LiveCode will attempt to emulate it. This emulation will typically be slower than random access on databases that support it. If the emulation does not succeed, then the <result> will be set to false.

Description:
Use the <revMoveToRecord> command to move around within the selected set of records.

If the command could not move to the specified record, then the value of the <result function> will be set to false, otherwise it will be set to true.

The <revMoveToRecord> command is currently supported by MySQL, PostgreSQL and SQLite. On ODBC, it will work providing that a forward only cursor has not been selected. For more information on ODBC Cursor types, please see the <revOpenDatabase function>. The <revMoveToRecord> command is not supported by Oracle at the moment and will just return false.

If you are using older database drivers (i.e. pre version 3.5), this command will not be supported. The error "revdberr,not supported by driver" will be thrown.

References: revMoveToPreviousRecord (command), revMoveToNextRecord (command), result (function), result function (function), revOpenDatabase function (function)
