next up previous contents
Next: 3.3.2.4 Property Access in Up: 3.3.2 Using Methods and Previous: 3.3.2.2 Default methods   Contents


3.3.2.3 Generic LuaCOM objects

To read or write properties in generic LuaCOM objects, it's necessary access them as method calls with the right prefix (get/set). The simpler semantic of table field access does not work here.
obj_typ = luacom.CreateObject("Some.TypedObject")
obj_untyp = luacom.CreateObject("Untyped.Object")
-- property read (get)
a = obj_typ.Value
b = obj_untyp:getValue()
-- property write (set)
obj.typ = a + 1
obj_untyp:setValue(b + 1)


Fabio Mascarenhas de Queiroz 2005-06-06