| System Functions |
|
| Format | KGN([ext_key$],data$,key_def$,key_num
[ , SEP=sepchar$ ] [,ERR=stmtref])
|
|||||||||||||
| Returns | Key of record in file, given the record's contents. | |||||||||||||
| Description | The
KGN( ) function returns a string
comprising the key of the record provided. This function
can be used to determine the value of an alternate (or
primary) key of a record, given the record's contents
(and external key, if present). When comparing keys with descending segments, an application can specify the key number as a negative value. In this case, the descending segments will be inverted so that a logical compare will function properly. |
|||||||||||||
| Example | 0010
OPEN (13)"Cstfile" 0020 IF PRM('BX')=0 THEN X$=MID(FIB(13),85) ELSE X$=MID(FIN(13),86,385) 0030 K$=KEY(13,END=0070) 0040 READ RECORD (13,KEY=K$)R$ 0050 PRINT "Key: ",K$," Alt: ",KGN(K$,R$,X$,1) 0060 GOTO 0030 0070 PRINT "End-of-file" 0080 END |
|||||||||||||