116
6.2.29. Extended function library
toboolean(value)
Converts the given value to boolean using following rules: nil,
boolean false, 0, empty string, '0' string are treated as false, everything else as true
string.split(str, sep)
Splits the given string into chunks by the given separator. Returns Lua table.
knxlib.decodeia(indaddressa, indaddressb)
Converts binary-encoded individual address to Lua string. This function accepts either one or
two arguments (interpreted as two single bytes).
knxlib.decodega(groupaddressa, groupaddressb)
Converts binary-encoded group address to Lua string. This function accepts either one or two
arguments (interpreted as two single bytes).
knxlib.encodega(groupaddress, separate)
Converts Lua string to binary-encoded group address. Returns group address a single Lua
number when second argument is nil or false and two separate bytes otherwise.
ipairs (t)
Returns three values: an iterator function, the table t, and 0, so that the construction
for i,v in ipairs(t)do body end
next (table [, index])
Allows a program to traverse all fields of a table. Its first argument is a table and its second
argument is an index in this table. next returns the next index of the table and its associated
value. When called with nil as its second argument, next returns an initial index and its
associated value. When called with the last index, or with nil in an empty table, next returns nil.
If the second argument is absent, then it is interpreted asnil. In particular, you can use next(t) to
check whether a table is empty. The order in which the indices are enumerated is not specified,
even for numeric indices. (To traverse a table in numeric order, use a numerical for or the ipairs
function.)The behavior of next is undefined if, during the traversal, you assign any value to a
non-existent field in the table. You may however modify existing fields. In particular, you may
clear existing fields.
pairs (t)
Returns three values: the next function, the table t, and nil, so that the construction
for k,v inpairs(t)do body end
will iterate over all keyvalue pairs of table t.
tonumber (e [, base])