Question

Background being java programming. And, no REAL introduction to LUA. 

I have this 

ClassName.name = "name"

That gets an error of attempting to index a nil value? I am practicing LUA for the first time in an already developed environment (par my work).

first is this a compile time or run time error?

I never created a name value so how could it already be nil?

Does Lua compile top to bottom? Or in logical order?

Lua is a single pass, top-to-bottom interpreter.  Names have to be defined before you use them. For ClassName, did you make it a table before you tried to assign a member to it?

local ClassName = {} ClassName.name = "name"

?? or some other constructor that returns a table value to ClassName?

Rob

Lua is a single pass, top-to-bottom interpreter.  Names have to be defined before you use them. For ClassName, did you make it a table before you tried to assign a member to it?

local ClassName = {} ClassName.name = "name"

?? or some other constructor that returns a table value to ClassName?

Rob