table expand headers
This function resolves specified table headers headers in the following way and returns the result in the return value.
This function provides three different options to resolve header specifications:
Indirect parameter passing is disabled
2-3
No. | Type | Description |
---|---|---|
1 input |
string | Name of existing table |
2 input |
table columns | Columns Specific rules apply for this function:
See table columns as function parameters for general ruling for this parameter. |
3 input |
string | Option Following options are available:
See table columns as function parameters for general ruling for this parameter. |
Type | Description |
---|---|
set | Expanded list of headers Individual header names, and/or column numbers. |
Table not found
Columns not found
table initialize( t, { { Name, Street, '', '', Town, Postal Code, Town, Region, Country, Continent, Phone, 'E-Mail' } } );
echo( "Table headers: ", [t:..,0], new line);
echo( "Input: { Name, '', 3, Town, '>Town', '..', Continent, 1 }");
echo( " ", table resolve headers( t, { Name, '', 3, Town, '>Town', '..', Continent, 1 } ) );
echo( " ", table resolve headers( t, { Name, '', 3, Town, '>Town', '..', Continent, 1 }, prefer names ) ); // Same as above
echo( " ", table resolve headers( t, { Name, '', 3, Town, '>Town', '..', Continent, 1 }, use names ) );
echo( " ", table resolve headers( t, { Name, '', 3, Town, '>Town', '..', Continent, 1 }, use numbers ) );
echo(new line, "And when all columns are selected:");
echo( " ", table resolve headers( t, '*', prefer names ) );
echo( " ", table resolve headers( t, '..', prefer names ) ); // Same as above
echo( " ", table resolve headers( t, '*', use names ) );
echo( " ", table resolve headers( t, '*', use numbers ) );
Table headers: {'Name','Street','','','Town','Postal Code','Town','Region','Country','Continent','Phone','E-Mail'}
Input: { Name, '', 3, Town, '>Town', '..', Continent, 1 }
{'Name',2,3,'Town','Postal Code',6,'Region','Country','Continent','Street'}
{'Name',2,3,'Town','Postal Code',6,'Region','Country','Continent','Street'}
{'Name','','','Town','Postal Code','Town','Region','Country','Continent','Street'}
{0,2,3,4,5,6,7,8,9,1}
And when all columns are selected:
{'Name','Street',2,3,'Town','Postal Code',6,'Region','Country','Continent','Phone','E-Mail'}
{'Name','Street',2,3,'Town','Postal Code',6,'Region','Country','Continent','Phone','E-Mail'}
{'Name','Street','','','Town','Postal Code','Town','Region','Country','Continent','Phone','E-Mail'}
{0,1,2,3,4,5,6,7,8,9,10,11}