This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Turn off light in 4 hours
#6
From Lua docs about colon (:) usage on strings:

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


Messages In This Thread
Turn off light in 4 hours - by RSV4 - 18.07.2015, 10:48
RE: Turn off light in 4 hours - by Pawel - 18.07.2015, 18:51
RE: Turn off light in 4 hours - by admin - 20.07.2015, 06:10
RE: Turn off light in 4 hours - by RSV4 - 20.07.2015, 08:01
RE: Turn off light in 4 hours - by Pawel - 20.07.2015, 09:29
RE: Turn off light in 4 hours - by admin - 21.07.2015, 08:19
RE: Turn off light in 4 hours - by edgars - 22.01.2016, 07:58

Forum Jump: