table.CopyFromTo

From Garry's Mod
Jump to: navigation, search
 table.CopyFromTo( )

Contents

Description

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

Arguments

table source

The table to copy from.

Arguments

table target

The table to write to.

Examples

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
Personal tools
Navigation