<doc>
  <legacy_id>1416</legacy_id>
  <name>revCurrentRecord</name>
  <type>function</type>
  <syntax>
    <example>revCurrentRecord(<i>recordSetID</i>)</example>
  </syntax>
  <library>Database library</library>
  <objects>
  </objects>
  <synonyms>
    <synonym>revdb_currentrecord</synonym>
  </synonyms>
  <classification>
  </classification>
  <references>
    <command tag="revMoveToNextRecord">revMoveToNextRecord Command</command>
    <function tag="revdb_movefirst">revdb_movefirst Function</function>
    <function tag="revDatabaseColumnNumbered">revDatabaseColumnNumbered Function</function>
    <function tag="revdb_moveprev">revdb_moveprev Function</function>
    <function tag="revdb_movelast">revdb_movelast Function</function>
    <function tag="revdb_movenext">revdb_movenext Function</function>
    <function tag="revQueryIsAtStart">revQueryIsAtStart Function</function>
  </references>
  <history>
    <introduced version="1.1">Added.</introduced>
    <changed version="2.0"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
    <disk access="???"/>
    <network/>
  </security>
  <summary><glossary tag="return">Returns</glossary> the number of the current record in a <glossary tag="record set (database cursor)">record set (database cursor)</glossary>. </summary>
  <examples>
    <example>revCurrentRecord(bookSearchResults)</example>
    <example>put revCurrentRecord(it) into myRecordNumber</example>
  </examples>
  <description>
    <p>Use the <b>revCurrentRecord</b> <control_st tag="function">function</control_st> to find out which <glossary tag="record">record</glossary> is currently being used.</p><p/><p><b>Parameters:</b></p><p>The <i>recordSetID</i> is the number <glossary tag="return">returned</glossary> by the <function tag="revQueryDatabase">revQueryDatabase function</function> when the <glossary tag="record set (database cursor)">record set</glossary> was created.</p><p/><p><b>Value:</b></p><p>The <b>revCurrentRecord</b> <control_st tag="function">function</control_st> 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)</p><p/><p><b>Comments:</b></p><p>If the operation is not successful, the <b>revCurrentRecord</b> <control_st tag="function">function</control_st> returns an error message that begins with the <keyword tag="string">string</keyword> "revdberr".</p><p/><p>If the <b>revCurrentRecord</b> 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.</p><p/><p>If the <b>revCurrentRecord</b> 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.</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revCurrentRecord</b> <control_st tag="function">function</control_st> is part of the <glossary tag="Database library">Database library</glossary>. To ensure that the <control_st tag="function">function</control_st> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure the "Database Support" checkbox is checked and the database drivers you are using are selected in the list of database drivers.</p><p/><p><b>Changes:</b></p><p>The <b>revCurrentRecord</b> synonym was added in version 2.0.</p>
  </description>
</doc>