512
RNO( ) Function
Return Next Record Number
Format
RNO(chan[,fileopt])
Where:
chan
Channel or logical file number of the file to reference.
fileopt
END=stmtref END-OF-FILE transfer
ERR=stmtref Error transfer
IND=num Record index
KEY=string$ Record key
KNO=num | name$ File access key number (num) or name (name$)
Returns
Integer, position of next/given record.
Description
The RNO( ) function reports the position in the file specified of either the next record, or
the record identified in the KEY= or IND= options. The RNO( ) value is the absolute
ordinal position of the record in the file. The first record in a file returns a value of 1
(one), the second RNO( ) value is 2, and so on. In a Keyed file, the record number
depends on the key chosen and its value relative to all other records in the same file.
Note: ProvideX supports the RNO( ) function for ODBC files. See File Handling in the
ProvideX User's Guide.
Example
0010 OPEN (13)"PVX_KEYD"
0020 INPUT "Which record? ",@(15),K$,
0030 IF K$="" THEN CLOSE (13); PRINT "DONE"; STOP
0040 READ (13,KEY=K$,ERR=0100)
0050 PRINT " Key ",K$," is Rec# ",RNO(13,END=0130)
0060 GOTO 0020
0100 REM 100
0110 PRINT " is invalid",@(40),"...Please try again"
0120 GOTO 0020
0130 PRINT @(22),"...Sorry...END-OF-FILE"
0140 END
-:end
-:run
Which record? ABCDEF is invalid ...Please try again
Which record? 123456 Key 123456 is Rec# 2
Which record? 123460 Key 123460 is Rec# 6
Which record? 123458 Key 123458 is Rec# 4
Which record? DONE ! User hit <Enter>
-:run
Which record? 123461 ...Sorry...END-OF-FILE