HOW to convert from actionscript to lua

Hello, 

i don´t know to convert to lua from actionscript:

extra=10

this[“variable”+extra].x=100;  

i want to write: variable10.x=100;

[“variable”+extra] not work it in LUA…

…in lua how to write this???

Thanks for you help.

javascript overloads ‘+’ for string concatenation (always thought it was a bad idea). In lua + actually means add, so if you write “variable”+extra it tries to cast them both to number types and fails.

what you want is this[“variable”…extra] - … is lua’s string concatenation operator - it will coerce the number to a string.

javascript overloads ‘+’ for string concatenation (always thought it was a bad idea). In lua + actually means add, so if you write “variable”+extra it tries to cast them both to number types and fails.

what you want is this[“variable”…extra] - … is lua’s string concatenation operator - it will coerce the number to a string.