lua - How to check the value of a boolean (set by user) with a variable string? -


the user sets boolean true or false.

that (exemple)

elementnameone = true elementnametwo = false elementnamethree = true 

etc.

now have string loaded file. string called name can have values nameone, nametwo, namethree, etc. of them @ time. able this

if element .. name == true 

except don't know how properly.

i've tried do

if not not ("element" .. name) 

but not work.

can ?

thanks

try this:

if _g["element" .. name] == true     -- end 

note work if variables set user (elementnameone, .. etc.) globals.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -