21.07.2015, 08:19
From Lua docs about colon (:) usage on strings:
Short example for objects:
Quote:The string library provides all its functions inside the table string. It also sets a metatable for strings where the __index field points to the string table. Therefore, you can use the string functions in object-oriented style. For instance, string.byte(s, i) can be written as s:byte(i).
Short example for objects:
Code:
obj = grp.find('1/1/1')
-- both lines do exactly the same thing
obj:write(false)
grp.write(obj.address, false, obj.datatype)