Lua Programming/How to Lua/dot

Referencing table elementsEdit

The dot symbol can be used to separate elements and subelements from the table name when referencing table elements:

print (student.age)    -- we could have used alternative syntax: print (student["age"])
Last modified on 1 March 2011, at 00:49