Garry's Mod Wiki

table.CopyFromTo

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

Page Links


Special Pages


Wikis

?

Render Time: 74ms

DB GetPage 47
Generate Html 4
SaveChanges (1) 9
Render Body 0
Render Sidebar 12