Reputation: 173
is it possible to convert a string into a name of a table entry? just like
string = "test"
y = {test = 123}
print y.string
So if string is "test" it would print y.test if there is such a entry
Hope you understand my question!
Thanks in advance...
Upvotes: 1
Views: 115
Reputation: 5525
print(y[string])
Be careful with using names such as string for variables, especially globals. You've just overwritten the string table.
Upvotes: 4