table search row
This function works through all table rows until the expression specfified returns true. The row number is returned.
Indirect parameter passing is disabled
This function provides a table context for partial table specifications with table name and row number for selected function parameters
2-3
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2. code |
expression :string |
Expression to select rows Specify the conditions or rules to select the row. See expressions to select rows. |
Opt. 3. input |
numeral | Starting row number Note: Negative row numbers count from last row upwards |
Type | Description |
---|---|
numeral | Row number with match found -1 is returned if no match has been found. |
table initialize ( table 1,
{ { Animal, leg count }, { Worm, 0}, { Bird, 2 }, { Dog, 4 }, { Fly, 6 }, { Tick, 8 } } );
r[1] = table search row( table 1, [Animal]='*i*' );
r[2] = table search row( table 1, ([Animal]='*i*'), r[1]+1 );
r[3] = table search row( table 1, ([Animal]='*i*'), r[2]+1 );
// Note that comparison is in parentheses, so the next function parameter is not regarded
// as part of a comparison expression.
echo( "1st match: ", r[1] );
echo( "2nd match: ", r[2] );
echo( "3rd match: ", r[3] ); // -1 because only 2 words containing 'i' exist.
1st match: 2
2nd match: 5
3rd match: -1
table read column selected rows
table find row
table selected columns