countchildrenΒΆ

nil countchildren ( Node node , string type , [ string|function pattern ] , [ boolean recursive ] )

Returns the number of children.

The countchildren function is written as:

function countchildren (...)
    local    count = 0
    for node in children (...) do
        count = count+1
    end
    return count
end
Arguments:

  • node The parent node to count children
  • type A class the children to count
  • pattern A Lua's pattern used to check the name of the node, or a function that filter the node. See Lua's pattern documentation.
  • recursive if true, traverse the children recursively.