revMoveToRecord

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
revMoveToRecord <recordSetId>, <recordNumber>
Associationsdatabase library
Summary

Moves to the specified record in a record set.

Introduced3.5
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
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)

Example
revMoveToRecord tCursor, the menuHistory of button "Record Number"
revMoveToRecord tCursor, tCurrentRecord + kRecordsPerPage
Values
NameTypeDescription
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.

RelatedCommand: revMoveToPreviousRecord, revMoveToNextRecord
Function: result, revOpenDatabase
Glossary: function, record set
Library: Database library
Securitydisk, network
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.