[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| RECNO |
+---------------------------------+
RECNO([<expN> | <expC>])
-----------------------------------
Returns current record number.
Return value - Numeric
-----------------------------------
RECNO() returns the current record number. The current record is the
record where the record pointer is positioned.
RECNO() returns a value that's one greater than the number of records in
the file if the record pointer is positioned beyond the last record in
the file. RECNO() returns 1 if the record pointer is positioned before
the first record in the file.
If the database is empty, RECNO() returns 1 and EOF() returns true
(.T.).
<expN> | <expC>
If you don't specify a work area or alias, RECNO() returns the current
record number for the database file in the currently selected work area.
To return the current record number for a database open in another work
area, include the work area number <expN>, or the database alias <expC>.
If a database isn't open in the work area you specify, RECNO() returns
zero. If a database doesn't have the alias you specify, the message
"Alias not found." is displayed.
RECNO(0) -- Soft Seek
After an unsuccessful SEEK in an indexed database, RECNO(0) uses "soft
seek" logic to determine the record number to return. If the SEEK is
unsuccessful and no matching record is found, RECNO(0) returns the
record number of the next closest match. If a close match cannot be
found, RECNO(0) returns 0.
If the seek value is greater than the last record in the database, the
message "Record out of range" is issued for the GO RECNO(0) statement.
+---------------------------------+
| Program Example |
+---------------------------------+
The result from the program would be: Closest matching company is
Jordon Books
USE customer
SET ORDER TO company
SEEK 'John Doe'
IF FOUND()
DISPLAY
ELSE
GOTO RECNO(0)
? 'Closest matching company is ' + company
ENDIF
-----------------------------------
See Also: GO, RECCOUNT(), RECSIZE(), SKIP
-----------------------------------
See Also:
GO
RECCOUNT()
RECSIZE()
SKIP
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson