Equinox Online Help - Language Reference - A to Z

Home

FindRecord

Applies to
SyntaxFindRecord OperatorExpression, Test1Expression [, Test2Expression, Test3Expression, Test4Expression]
Action[Statement] Finds a record with a specified index value.
ScopeOnly usable in forms or subtables.
Notes

This statement searches for the first record with a specified index value. The search operates by comparing the current index with a test value. OperatorExpression is a 2-character code that defines the condition for the search. The possible codes for OperatorExpression are:

  • LT Less than
  • LE Less than or equal to
  • EQ First equal to
  • QE Last equal to
  • GE Greater than or equal to
  • GT Greater than

The search is always carried out against the current index. You may therefore need to select the appropriate index using SetIndex before starting the search.

Equinox indexes may be based on up to four fields. The search is conducted against each field separately and these values are supplied as the arguments Test1Expression to Test4Expression. You may use as many arguments as there are fields in the index. eg If an index uses two fields then you may search against the first indexed field only, or the first and second fields. Any of the TestExpression arguments may be MakeKey values.

Also note that the search is based in index position rather than absolute value. This means that when using a reverse order index, the logic for "greater than" and "less than" is reversed. eg Searching for a reverse order numeric index value which is greater than six will return five rather than seven, because record five appears after record six.

The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero.

CategoryRecord location
See Also CountRecords, CurrentTableName, FindRecord, FindRecordLock, GroupFindRecord, IsLookup, IsRecord, IsSameRecord, Lookup, LookupWrite, SameRecord
Example

This method selects an index which is based on the customer name and then finds a default record appropriate for a point-of-sale system.

SetIndex CustIdx
FindRecord EQ, "CASH"