table delete remaining rows (if needed)

Prev Next

Function Names

table delete remaining rows, table delete remaining rows if needed

Description

This function deletes all remaining rows from the specified row till the end of the table.

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.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

2

Parameters

No.TypeDescription
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.

Exceptions

Table not found

Examples

  table initialize ( table 1,
  { { Animal, leg count }, { Worm,  0}, { Bird, 2 }, { Dog, 4 }, { Fly, 6 }, { Tick, 8 } } );

  table delete remaining rows( table 1, 3 );

  table list( table 1 ); // Only Worm and Bird are left.

Output

    0 : Animal | leg count
    1 : Worm   | 0        
    2 : Bird   | 2        

Try it yourself: Open LIB_Function_table_delete_remaining_rows.b4p in B4P_Examples.zip. Decompress before use.

See also

table delete rows