10.14.5 Find a Record (FIND)

Syntax

FIND [IN] fname [WHERE condition];

Fname is an internal file name declared earlier. The WHERE clause is optional and if omitted is the same as:

WHERE $TRUE

Any nonunique field references in condition will be resolved using fname.

Purpose

FIND will search fname to find the first record that will satisfy the condition. If there are no records that satisfy the condition, all the fields are set to zeros or empty strings (whichever is appropriate for the field type).

The WHERE clause specifies the condition for record searching. If this clause is omitted then the first active record in the file is returned. For more advanced search conditions, see the section on record selection at the end of this chapter.

Examples:

FIND invoice;

FIND IN inventory

WHERE part EQ invoice.part;