version 3
Record number {(table)} Number
| Parameter | Type | Description | |
| table | Table | Table for which to return the | |
| number of the current record, or | |||
| Default table, if omitted | |||
| Function result | Number | Current record number |
Description
Record number returns the physical record number for the current record of table. If there is no current record, such as when the record pointer is before or after the current selection, Record number returns 1. If the record is a new record that has not been saved, Record number returns 3.
Record numbers can change. The record numbers of deleted records are reused. Record numbers will also change if you compact the database or perform a recover by tags operation on the database using 4D Tools. During a transaction, a newly created record has a temporary record number. After the transaction has been accepted, the record is assigned a regular record number.
Example
The following example saves the current record number and then searches for any other records that have the same data:
$RecNum:=Record number([People]) ` Get the record number
QUERY ([People]; [People]Last = [People]Last) ` Anyone else with the last name?
` Display an alert with the number of people with the same last name
ALERT ("There are "+String (Records in selection([People])+" with that name.")
GOTO RECORD ([People]; $RecNum) ` Go back to the same record
See Also
About Record Numbers, GOTO RECORD, Is new record, Selected record number, Sequence number.