Is this what you are after?
Code: Select all
table1 = {1, 2, 3}
table2 = {"a", "b", "c"}
TableIWant = table2
DebugPrint(TableIWant[1])
And to explain the difference.
TableIWant = "table2"
means that TableIWant is not a table, but is a string containing characters "table2"
By leaving quotes out however, the TableIWant = Table2, means that TableIWant becomes same as variable Table2, which happens to be a table.
Notice also that TableIWant is NOT a COPY of a table2, but it is a REFERENCE to Table2, so whatever you do to TableIWant, will also happen to table2.
if you wish to make INDEPENDENT COPY of table2, then you need to use
CopyTable() - command to do it.
and example:
Code: Select all
table1 = {1, 2, 3}
table2 = {"a", "b", "c"}
TableIWant = table2
DebugPrint(TableIWant[1])
TableIWant[1] = 5
DebugPrint(Table2[1])
Notice How I changed TableIWant[1] value, and it also affected table2[1] value, since they are now practically same thing, as TableIWant is a reference or a pointer (not sure which one it is) to table2.
To put it short, TableIWant is accespoint to table2, unless changed to become access point to something else, for example:
TableIWant = table1
after which everything done to TableIWant, will also affect table1, but not table2 anymore.
So TableIWant used this way is always an access point to another table, which however can change to whom it works as an access point.