XBase.Find

Syntax:

Find(<Key>, <Mode>)

Parameters:

<Key> (required)

Type: String.
Current index expression value.

<Mode> (required)

Type: String.
Record search mode:
  • "=" - searches for an exact key match;
  • ">=" - searches for an exact key match or greater;
  • ">" searches for a value greater than the key;
  • "<=" - searches for an exact key match or less;
  • "<" searches for a value less than the key;

Returned value:

Type: Boolean.
True - record found; False - otherwise.

Description:

Searches records corresponding to the indicated key value in accordance with the current index and the search mode that was passed as a parameter. A pointer is set is established in the record that was found.

Availability:

Thin client, server, thick client, external connection.

Note:

Please note that when working with an XBase object in database tables, the object calculates index values independently, based on expressions that were passed to it when creating the key. When using this method, you must calculate the value Key using the script, which can create certain problems, if a compound index or fields included in an index expression are non-string, etc. Therefore, this method is applicable only for simple string index expressions. For more complex situations, you must apply the universal FindByKey() method.

Example:

// Find record by key value
xB.CurrentIndex = xB.Indexes.IDXCODE; // index CODE
RecordsFound = xB.Find("00001", ">=");

See also:

XBase, property CurrentIndex

    

1C:Enterprise Developer's Community