table flip rows

Prev Next

Function Names

table flip rows

Description

This function flips (i.e. mirrors) the rows in the table. Either all rows except the header row can be flipped, or a specified range, which may, in this case, include the header row.

Call as: procedure

Restrictions

Indirect parameter passing is disnabled.

Parameter count

1-3

Parameters

No.TypeDescription
1.
input
string Name of existing table

The rows in this table will be flipped

Opt. 2.
input
numeral Starting row number

Flipping starts at this row. It must refer to an existing row. Row 0 is allowed. Negative values are allowed where -1 refers to the bottom row. No rows will be flipped if the starting row is below ending row.

Opt. 3.
input
numeral Ending row number

Flipping ends at this row. It must refer to an existing row. Negative values are allowed where -1 refers to the bottom row. No rows are flipped if the ending row is above the starting row.

Examples

       table initialize( t,
                { { Last Name,   First Name },
                  { Andersen,    Anders },
                  { Donaldson,   Donald },
                  { Johansson,   John },
                  { Poulsen,     Paul },
                  { Svensson,    Sven } } );

       table flip rows ( t, 1, 3 );
       table list ( t );

Output

    0 : Last Name | First Name
    1 : Johansson | John      
    2 : Donaldson | Donald    
    3 : Andersen  | Anders    
    4 : Poulsen   | Paul      
    5 : Svensson  | Sven      

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

See also

table flip selected rows
table flip vertically
table flip columns
table transpose