i = seek(multiple-item condition[,numeric-expr]);
The seek function returns the occurrence number of the first item in a multiply occurring item that satisfies a certain condition. If numeric-expr is included, the function starts searching the multiply occurring record for a true condition starting at occurrence numeric-expr. If a @ symbol precedes the numeric-expr, the function searches for the nth occurrence of the condition.
The function returns the occurrence number of an item that meets the condition or 0 if no such item is found.
femaleIndex = seek(SEX = 2);
while femaleIndex do
write("Person #%d is a female with name '%s'",femaleIndex,NAME(femaleIndex));
femaleIndex = seek(SEX = 2,femaleIndex + 1);
numeric secondSpouse = seek(RELATIONSHIP = 2,@2);