PROP:CurrentKey

Top  Previous  Next

Property of a FILE that returns a reference to the current KEY or INDEX being used for sequential processing, or the current key being built during a BUILD or PACK operation (READ ONLY). Valid only as the source side of a reference assignment statement or in a logical expression comparing the return result to NULL. Returns NULL if the file is being processed in record order.

Example:

KeyRef &KEY

Customer FILE,DRIVER('Clarion'), PRE(Cus)

NameKey  KEY(Cus:Name),DUP

Record   RECORD

Name     STRING(20)

    . .

CODE

OPEN(Customer)

SET(Customer)

KeyRef &= Customer{PROP:CurrentKey)   !Returns NULL

IF Customer{PROP:CurrentKey) &= NULL   !Compare to NULL

 MESSAGE('SET to record order')

END

SET(Cus:NameKey)

KeyRef &= Customer{PROP:CurrentKey)   !Returns reference to Cus:NameKey