table.copyContents

Syntax table.copyContents (addr1, addr2)

Params addr1 is the Object Database address of the table containing the information to be copied.

addr2 is the Object Database address of the table to which the contents of the table at addr1 are to be copied.

Action Copies everything in table addr1 to the table at addr2.

Returns True

Examples The examples table contains a table called table1 with four entries: a string, a number, a script, and an outline. It also has an empty table called table2. The following line copies the contents of table1 into table2, replacing any object in table2
with a name identical to an object in table1.
table.copyContents(@examples.table1, @examples.table2)

   » true

Examine examples.table2 and you'll see that it now has the four items that were originally in examples.table1 (and which, of course, remain in their original place as well).

Errors If addr1 and addr2 are not both valid table addresses, an error is generated.

Notes This verb differs from table.copy in that it expects both addr1 and addr2 to be the addresses of tables.

table.copyContents is implemented as a Frontier script, so you can examine its logic.

See Also table.copy

table.move

table.moveContents

Discuss