table delete rows, table delete rows if needed
This function deletes a specified number of rows in a specified location.
The suffix ... if needed will suppress an exception if the rows to be deleted lie below the last table row.
In this case, no actions will happen.
Indirect parameter passing is disabled
2 - 3
No. | Type | Description |
---|---|---|
1. input |
string | Name of existing table |
2 input |
numeral | Row number Table rows begin with row 0 (header row). Negative indexing is supported, i.e. -1 = last table row. |
3 input |
numeral | Number of rows to delete Number of rows to delete. |
Table not found
table initialize ( table 1,
{ { Animal, leg count }, { Worm, 0}, { Bird, 2 }, { Dog, 4 }, { Fly, 6 }, { Tick, 8 } } );
table delete rows( table 1, 1, 2 ); // Deltess Worm and Bird
table delete rows( table 1, -1, 1 ); // Deletes Tick
table list( table 1 ); // Only Dog and Fly are left
0 : Animal | leg count
1 : Dog | 4
2 : Fly | 6