Topic complex |
Table functions |
Function |
autorecno() |
Short |
Returns the auto number of the actual record |
Syntax |
AUTORECNO(db : INTEGER) : INTEGER |
Parameter |
db : table-handle as returned by OPENDB.
|
Return |
If the table is numbered automatically, the function returns the auto number of the actual record, otherwise it returns the physical number of the record. |
See also: |
|
Description |
It is
IF AUTOFIELD(db)>0 THEN
RETURN GETRFIELD(db,AUTOFIELD(db))
ELSE
RETURN RECNO(DB)
END
If you access to the records by links or CGI-variables you should always use AUTORECNO(DB) instead of the physical numbers of records (ECO(DB)).
Includes the dedicated table an AUTO-INCREMENT-field the corresponding value of the record is returned. That makes a secure record reference possible, also in multiuser mode.
Then the number returned by AUTORECNO is remade to a physical number of the record by FINDAUTO.
|