Name: revCurrentRecord

Type: function

Syntax: revCurrentRecord(<recordSetID>)

Summary: <return|Returns> the number of the current record in a <record set (database cursor)(glossary)>.

Synonyms: revdb_currentrecord

Introduced: 1.1

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Security: disk,network

Example:
revCurrentRecord(bookSearchResults)

Example:
put revCurrentRecord(it) into myRecordNumber

Parameters:
recordSetID: The number returned by the revQueryDatabase function when the record set was created.

Returns: The <revCurrentRecord> <function> returns a number between 0 and the number of records in the record set - 1. The number represents the zero-based index of the current record. (i.e. 0 is the first record, 1 is the second etc).

Description:
Use the <revCurrentRecord> <function> to find out which <record> is currently being used.

If the operation is not successful, the <revCurrentRecord> <function> returns an error message that begins with the <string> "revdberr".

If the <revCurrentRecord> function returns a value of 0, this means that the cursor is at the start of the record set, pointing to the first record. Fetching data (with revDatabaseColumnNamed or revDatabaseColumnNumbered) will retrieve the first record.

If the <revCurrentRecord> function returns a value of equal to the number of records -1, this means that the cursor is on the last record. Fetching data will retrieve the last record.

>*Important:*  The <revCurrentRecord> <function> is part of the <Database library>. To ensure that the <function> works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section of the General screen of the <Standalone Application Settings> window, make sure the "Database Support" checkbox is checked and the database drivers you are using are selected in the list of database drivers.

Changes:
The revCurrentRecord synonym was added in version 2.0.

References: string (keyword), Database library (library), Revolution custom library (library), revMoveToNextRecord (command), revQueryIsAtStart (function), revdb_movefirst (function), revdb_moveprev (function), revdb_movelast (function), revDatabaseColumnNumbered (function), revdb_movenext (function), Standalone Application Settings (glossary), record (glossary), standalone application (glossary), record set (database cursor) (glossary), return (glossary), function (control_st)
