XBase.FindByKey

Syntax:

FindByKey(<Mode>)

Parameters:

<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 values of the Key properties in accordance with the current index and search mode, passed in the parameters. A pointer is set is established in the record that was found. When using this method, you must set the values of all the Key type object properties that are involved in calculating the current index expression.

Availability:

Thin client, server, thick client, external connection.

Example:

// Find by a complex key
xB.CurrentIndex = xB.Indexes.IDXCNAME; // index CODE + TRIM(NAME)
xB.Key.CODE = "00001";
xB.Key.NAME = "System unit";
RecordsFound = xB.FindByKey("=");

See also:

XBase, property Key
XBase, property CurrentIndex

    

1C:Enterprise Developer's Community