467
KEP( ) Function
Return Prior Record's Key
Format
KEP(chan[,fileopt])
Where:
chan
Channel or logical file number of your given file.
fileopt
END=stmtref End-of-File transfer
ERR=stmtref Error transfer
KNO=num | name$ File access key number (num) or name (name$).
stmtref
Program line number or label to transfer control to.
Returns
Key of the prior record in file
Description
The KEP( ) function returns the key of the record prior to the record in the file
specified. The result is based on:
· the current file access key or,
· the access key specified using the KNO= option.
If the current record is at the start of the file, there is no prior record. ProvideX
reports Error #2: END-OF-FILE on read or File full on write unless
you include an ERR= or END= option.
ProvideX supports the KEP ( ) function for ODBC files. For more information, see
File Handling in the ProvideX User's Guide.
Example
0010
OPEN (13)"CUSTNO"
0020
READ (13,KEY="zzz",DOM=30) ! Go to End of file
0030
LET K$=KEP(13,END=1000)
0040
READ (13,KEY=K$)R$
0050
PRINT "Key: ",K$," Data: ",R$
0060
GOTO 0030
1000
PRINT "Back to the start"
1010
END