next up previous contents
Next: 2.3.2.2 Property Access in Up: 2.3.2 Using Methods and Previous: 2.3.2 Using Methods and   Contents

2.3.2.1 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)


Vinicius da Silva Almendra 2003-06-04