So just write the data with a sequence number as in:
OPEN (1) "*memory*;keydef=[1:1:4:B],[2:1:10:C]"
WRITE (1) 1, "Dog"
WRITE (1) 2, "Cat"
WRITE (1) 3, "Pig"
WRITE (1) 4, "Ant"
WRITE (1) 5, "Pig"
WRITE (1) 6, "Zebra"
Now you can access by number (primary key) or by name (kno=1) plus you could add additional columns to the record if required. You can access this as follows:
->print rcd(1,key=4)
4
Ant
->print rcd(1,key="pig",kno=1)
3
Pig
->