Difference between revisions of "SHIP:Sail:getChildCount"

From Serious Documentation
Jump to: navigation, search
(Prototype)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[SHIP:Sail|SHIP Sail Reference Home]]
 
 
__NOTOC__
 
__NOTOC__
== getChildCount ==
+
{{SailFuncTableStart|}}<onlyinclude>
 
+
|{{SailFunc|getChildCount}}||{{DataType|String}}||style="text-align:center;"|v4.0||Gets a count of the total number of child {{DataType|Node}}s within an enclosing parent {{DataType|Node}}.</onlyinclude>
Gets a count of the total number of child nodes within an enclosing parent node.
+
|}
 +
== See Also: ==
 +
*[[SHIP:Sail|Sail Home]]
 +
*[[SHIP:Sail:Functions|Sail Functions]]
 +
*[[SHIP:Sail:Node Functions|Sail Node Functions]]
 +
*{{SailFunc|getChild}}, {{SailFunc|getChildIndex}}
  
 
== Prototype ==
 
== Prototype ==
 
+
<code>{{DataType|Integer}} {{SailFunc|getChildCount}}({{DataType|Node}} parentNode);</code>
<code>{{DataType|Integer}} getChildCount({{DataType|Node}} parentNode);</code>
 
 
 
 
=== Parameters/Return Value ===
 
=== Parameters/Return Value ===
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  
Line 15: Line 17:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|parentNode||{{DataType|Node}}||The node to look in for children
+
|parentNode||{{DataType|Reference}}:[[SHIP:Node|node]]||The {{DataType|Node}} to look in for children
 
|-
 
|-
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | {{DataType|Integer}}
 
! scope="col" style="text-align:left" | {{DataType|Integer}}
! scope="col" style="text-align:left" | number of direct children within the parent node
+
! scope="col" style="text-align:left" | number of direct children within the parent {{DataType|Node}}
 
|}
 
|}
 +
== Detailed Description ==
 +
The {{SailFunc|getChildCount}} function returns the number of direct children within the parent.
  
== Detailed Description ==
+
Nodes in [[SHIP]] may have 0 or more direct child nodes.  For example, a {{Node|group}} in the {{Node|resources}} area may have N {{Node|image}}s within the {{Node|group}}. These children, if present, are implicitly numbered <code>0..(N-1)</code> where <code>N</code> is the total number of children of any type within the parent {{DataType|Node}}.
  
The <code>getChildCount(parent)</code> function returns the number of direct children within the parent.
+
== Examples ==
  
Nodes in [[SHIP]] may have 0 or more direct child nodes.  For example, a {{Node|group}} in the {{Node|resources}} area may have N {{Node|image}}s within the {{Node|group}}. These children, if present, are implicitly numbered <code>0..(N-1)</code> where <code>N</code> is the total number of children of any type within the parent node.
 
  
== Examples ==
+
[[Category: Node Functions]]

Latest revision as of 14:36, 10 October 2016

Function Returns Introduced Description
getChildCount String v4.0 Gets a count of the total number of child Nodes within an enclosing parent Node.

See Also:

Prototype

Integer getChildCount(Node parentNode);

Parameters/Return Value

Parameter Data Type Description
parentNode Reference:node The Node to look in for children
Return Integer number of direct children within the parent Node

Detailed Description

The getChildCount function returns the number of direct children within the parent.

Nodes in SHIP may have 0 or more direct child nodes. For example, a group in the resources area may have N images within the group. These children, if present, are implicitly numbered 0..(N-1) where N is the total number of children of any type within the parent Node.

Examples