for all table selected rows
for all table selected rows ( table name, reference column, iterator value, iterator counter ) statement;
for all table selected rows ( table name, reference column, iterator value, iterator counter ) {statements; }
This loop works through all selected rows (except the header row) in the table and executes the subsequent statements accordingly.
The selection is done with the expression provided in the 2nd function parameter. This expression is executed for every row in order
to decide whether to run the following statements inside the loop or not.
.
Indirect parameter passing is disabled
This function provides a table context for partial table specifications with table name and row number
2-5
No. | Type | Description |
---|---|---|
1. input |
string | Table Name Name of exsting table |
2. code |
expression :string |
Expression to select rows Specify the conditions or rules to selecte the rows. See expressions to select rows. |
Opt. 3. input |
table columns | Reference Column Specify 1 column header name or 1 column number. This column will be used to count the rows in the table and return the iterator value from every row. If partial table references are used, the point (e.g. [.]) will refer to this specified column. |
Opt. 4 code |
variable :string |
iterator value This variable is updated by this function in order to provide the current value taken from the specified table column and referenced row. The variable is always of type 'quoted string', even if containing numbers or dates. You need to convert the type by hand if needed. |
Opt. 5 code |
variable :string |
iterator counter Equivalent to current row number while working throuh the table. This variable is updated by this function and provdes the index. It always begins with 0 and continues with 1, 2, etc. |
table initialize ( colors, { { EN, FR }, { red, rouge }, { blue, blue }, { green, vert }, { rose, rosé }, { yellow, jaune } } );
// Simple case with 2 parameters:
for all table selected rows( colors, [EN]='r*')
{
echo( [EN], " -> ", [FR] ); // All French colors ending with 'e'
}
// All 5 parameters in use:
// Note the extra parentheses for 2nd parameter to avoid hijacking further function parameters into the comparison
for all table selected rows( colors, ([FR]='*e'), EN, value[], index[] )
//
{
echo( "index ", index[], ": ",value[], " -> ", [FR] ); // All French colors ending with 'e'
}
red -> rouge
rose -> rosé
index 1: red -> rouge
index 2: blue -> blue
index 5: yellow -> jaune