table delete columns
This function deletes specified columns.
Deleting begins with the right-most column in the table, and not with the first (or last) column referenced. With this approach, the positions of the remaining
columns further to the left will not shift.
Indirect parameter passing is disabled
2-3
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2 input |
table columns | Existing columns See table columns as function parameters for general ruling for this parameter.
|
Opt. 3 input |
numeral | Number of columns to delete By default, the specified column will be deleted. |
Type | Description |
---|---|
numeral | Number of columns deleted |
Table not found
Header name not found
echo("Delete 3 column pairs");
table initialize ( table, { { 'Col A' .. 'Col K' }, { 'Val A' .. 'Val K' } } );
// Deletes 6 columns: H & I, C & D, and B & E. Remaining; A, F, G, J and K
echo( "# columns deleted: ", table delete columns ( table, {7, Col B, Col C}, 2 ) );
table delete columns ( table, Col A, 0 ); // Nothing happens here (0 columns deleted)
table list( table );
echo("Delete all columns between D and K");
table initialize ( table, { { 'Col A' .. 'Col K' }, { 'Val A' .. 'Val K' } } );
table delete columns ( table, Col F, -2 );
table list( table );
Delete 3 column pairs
# columns deleted: 6
0 : Col A | Col F | Col G | Col J | Col K
1 : Val A | Val F | Val G | Val J | Val K
Delete all columns between D and K
0 : Col A | Col B | Col C | Col D | Col E | Col K
1 : Val A | Val B | Val C | Val D | Val E | Val K