locate. Locating a specified value in a table

^table.locate[column_name;value_to_be_located]
^table.locate(logical_expression)
^table.locate[column_name;value_to_be_located;
options]
^table.locate(logical_expression)[options]

The method locates a specified
value in a specified column in the table and returns Boolean value "true/false" depending on whether it found the value or not. In case it locates the specified value, the row where the value is found is set as current. If the value was not located, current row is not shifted.

The second variant of calling method searches first record to conform
logical_expression.

One can also specify a number of options to control search, see "Copying and search options".

Search is case-sensitive
.

Example
$stuff[^table::create{name      pos
Ivanov   boss
Petrov   engineer
Lebedev   art-director
}]
^if(^stuff.locate[name;
Lebedev]){
   The entry is found in line ^stuff.line[].<br />
   
$stuff.
name$stuff.pos<br />
}{
   No such entry
}


The code will output:
The entry is found in line 3.
Lebedev: art-director



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 02.03.2011