Code: Select all
Table1 = {1, 2, 3}
DebugPrint(table1[1])
Table2 = Table1
DebugPrint(Table2[1])
table2[1] = 7
DebugPrint(table1[1])
DebugPrint(table2[1])
table1 = {4, 5, 6}
DebugPrint(table1[1])
DebugPrint(table2[1])
But when I empty Table1, Table2 seems to continue to exist still?
So how do Hollywood tables actually work when using Table1 = Table2, is it that Table1 and Table2 are both referencing to same memory location, instead of table2 referencing to table1, and when doing "Table1 = {4, 5, 6}" it now points to whole new memory location as in making a new table, while the Table2 continues to referencing to the same old memory location?
And if this is the case, then is it safe to continue using Table2, or might that memory location suddenly just disappear?