Difference between revisions of "SHIP:Sail:getChildIndex"

From Serious Documentation
Jump to: navigation, search
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
Added to [[SHIPEngine]] v4.0.211, [[SHIPTide_Beta_v4.0.211| SHIPTide v4.0.211]] .
+
{{SailFuncTableStart|}}<onlyinclude>
 
+
|{{SailFunc|getChildIndex}}||{{DataType|Integer}}||style="text-align:center;"|v4.0.211||Gets the index of a {{DataType|Node}} within its enclosing parent {{DataType|Node}}.</onlyinclude>
See Also:
+
|}
*[[SHIP:Sail|SHIP Sail Home]]
+
== See Also: ==
*[[SHIP:Sail:Functions|SHIP Sail Function Home]]
+
*[[SHIP:Sail|Sail Home]]
*[[SHIP:Sail:getChild |getChild()]],[[SHIP:Sail:getChildCount|getChildCount()]]
+
*[[SHIP:Sail:Functions|Sail Functions]]
 
+
*[[SHIP:Sail:Node Functions|Sail Node Functions]]
 
+
*{{SailFunc|getChild}}, {{SailFunc|getChildCount}}
== getChildIndex ==
 
Gets a index of a node within its enclosing parent node.
 
 
 
 
== Prototype ==
 
== Prototype ==
<code>{{DataType|Integer}} getChildIndex ({{DataType|Node}} node);</code>
 
  
 +
<code>{{DataType|Integer}} {{SailFunc|getChildIndex}}({{DataType|Node}} node);</code>
 
=== Parameters/Return Value ===
 
=== Parameters/Return Value ===
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  
Line 24: Line 21:
 
! 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" | index of specified node within parent node
+
! scope="col" style="text-align:left" | index of specified {{DataType|Node}} within parent {{DataType|Node}}
 
|}
 
|}
  
 
== Detailed Description ==
 
== Detailed Description ==
  
The <code>getChildIndex(node)</code> function returns the index of the specified node within its direct enclosing parent.
+
The {{SailFunc|getChildIndex}} function returns the index of the specified node within its direct enclosing parent.
  
 
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.
 
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 ==
 
== Examples ==
 +
 +
[[Category:Node Functions]]

Latest revision as of 17:51, 14 December 2016

Function Returns Introduced Description
getChildIndex Integer v4.0.211 Gets the index of a Node within its enclosing parent Node.

See Also:

Prototype

Integer getChildIndex(Node node);

Parameters/Return Value

Parameter Data Type Description
node Node The specified node you want the index of
Return Integer index of specified Node within parent Node

Detailed Description

The getChildIndex function returns the index of the specified node within its direct enclosing 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