HyperMath

Copying a Table

Copying a Table

Previous topic Next topic No expanding text in this topic  

Copying a Table

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

copy = CopyTable(t)

Option

Description

t

An existing table.

copy

A copy of the table.

Tables cannot be copied by assignment using the equal sign, otherwise they will remain linked; changing individual elements in one will change the same elements in the other (they share the same memory).  Instead, the above utility function must be used to copy tables.

See the topics Passing Arguments and Multiple Returns for further implications of this for passing/returning tables to and from a function.