Code: Select all
mytable = {
["variable"] = 1
}
mystring="variable"
mytable[mystring] = 2Code: Select all
variable = 1
mystring = "variable"
mystring = 2What I am after with this is that perhaps I would like to debug my program, and it could be handy that i could in middle of program push some predefined button, as example "c", and it would ask me to give me both variables name, and its new value. Then i would simply put for example: "Speed" and "10", and after this, program would execute "Speed = 10", and i could see if bug occurs now or not.
The beginning version is one possiblity, but it means that all my variables should then reside in one and same table. What I would like to have, is to still have the freedom of using my own variables like i have been doing before, yet be able to change their values using Strings to tell what variable i want to be changed.
Is this possible, and how?