Garry's Mod Wiki

Garry's Mod Wiki

  table.CopyFromTo( table source, table target )

Description

Empties the target table, and merges all values from the source table into it.

Arguments

1 table source
The table to copy from.
2 table target
The table to write to.

Example

Demonstrates the use of this function.

local Test1 = {A = "String keys", B = "Table 1"} local Test2 = {"Numeric keys", "Table 2"} table.CopyFromTo( Test2, Test1 ) PrintTable( Test1 )
Output:
1 = Numeric keys 2 = Table 2

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...