table copy table

Prev Next

Function Names

table copy table

Description

This function makes one or more copies of the specified table with all contents. If the specified new tables are already existing, then they will be cleared first.

Call as: procedure

Restrictions

Indirect parameter passing is disabled

Parameter count

Min 2

Parameters

No.TypeDescription
1.
input
string Name of existing table

2 ...
input
string Name of new table

Examples

       table initialize( t, {{ Name, Age }, { Ann, 45 }, { Dan, 35 }} );
       table copy table ( t, u, v );

       echo("Listing tables u and v");
       table list ( u );
       table list ( v );

       // Do the same with multiple table names in parameters

       table copy table( t, {a, b}, c, {d, e} );

       echo("List one table: e");
       table list ( e );

       echo("Checkif tables a...f are existing");
       echo( table existing( {a..f} ) );

Output

Listing tables u and v
    0 : Name | Age
    1 : Ann  | 45
    2 : Dan  | 35

    0 : Name | Age
    1 : Ann  | 45
    2 : Dan  | 35

List one table: e
    0 : Name | Age
    1 : Ann  | 45
    2 : Dan  | 35

Checkif tables a...f are existing
{true,true,true,true,true,false}
Try it yourself: Open LIB_Function_table_copy_table.b4p in B4P_Examples.zip. Decompress before use.

See also

table copy table selected rows
table copy table columns