for all table selected columns
for all table selected columns ( table name, comparison expression, reference row number, iterator column number, iterator value, iterator counter ) statement;
for all table selected columns ( table name, comparison expression, reference row number, iterator column number, iterator value, iterator counter ) {statements; }
The loops works through selected columns (where comparisons do match) in the table specified and executes the following statements specified.
Indirect parameter passing is disabled
This function provides a table context for partial table specifications with table name, row number and column number
2-6
No. | Type | Description |
---|---|---|
1 input |
string | table name Name of existing table |
2 code |
comparison expression :string |
comparison expression This expression is applied to compare the column header names, regardless of row number specified in the 2nd parameter.
The checking is done once before the loop starts. The loop behavior will not be affected if the header names are changed afterwards,
for example renamed. Attention to inserting and deleting columns: The loop has memorized the actual column numbers
(which will not change) and not the header names.
|
Opt. 3 input |
numeral | reference row number Positive values must be between 0 and number of table rows minus 1.
|
Opt. 4 code |
variable :string |
iterator column number This value refers to the current column number |
Opt. 5 code |
variable :string |
iterator header name This value refers to the current column header name |
Opt. 6 code |
variable :string |
iterator counter This variable is updated by this function and provdes the index. It always begins with 0 and continues with 1, 2, etc. |
table initialize( animals,
{{ Name, Class, Number of Legs,Surface},
{ Dog, Mammal, 4, Hair }, { Snake, Reptile, 0, Skin }, { Parrot, Bird, 2, Feathers }} );
// Choose all columns with headers containing 's'. The list results for row 2.
for all table selected columns( animals, ('*s*'), 2, column[], header[], i[] ) // Leg count skipped
{
echo( i[],": Column ", column[], " (", header[], ") = ", [column[]] );
}
echo;
for all table selected columns( animals, ('*s*'), 2, column[]) // Leg count skipped
{
echo( "Column ", column[], " (", [.,0], ") = ", [.] );
}
echo;
for all table selected columns( animals, ('*s*') ) // Leg count skipped
{
echo( " (", [.], ") = ", [.,2] );
}
0: Column 1 (Class) = Reptile
1: Column 2 (Number of Legs) = 0
Column 1 (Class) = Reptile
Column 2 (Number of Legs) = 0
(Class) = Reptile
(Number of Legs) = 0
for all table columns
for all current table columns
for all current table selected columns