Difference between revisions of "SHIP:Data Types:Node"

From Serious Documentation
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
 
|{{DataType|Node}}||Reference to a [[SHIP:Node|node]].
 
|{{DataType|Node}}||Reference to a [[SHIP:Node|node]].
 
|}</onlyinclude>
 
|}</onlyinclude>
Properties that are of type {{DataType|Node}} must receive a value that is known at SHIPTide time, not a value that is dynamically assigned at run time. For example, the following statement will fail:
+
In general, functions that require parameters of type {{DataType|Node}} must receive a value that is known at SHIPTide time, not a value that is dynamically assigned at run time. For example, the following statement will fail:
 
  <code>{{SailFunc|getChildIndex}}({{SailFunc|getChild}}(myParent, index));    // fails instead of returning index</code>
 
  <code>{{SailFunc|getChildIndex}}({{SailFunc|getChild}}(myParent, index));    // fails instead of returning index</code>
  
The above code is illegal since {{SailFunc|getChildIndex}} expects a static reference to a [[SHIP:Node|node]], not one created at runtime through the {{SailFunc(getChild}} function.
+
The above code is illegal since {{SailFunc|getChildIndex}} expects a static reference to a [[SHIP:Node|node]], not one created at runtime through the {{SailFunc|getChild}} function.

Latest revision as of 05:36, 14 July 2014

See Also

Node

Data Type Description
Node Reference to a node.

In general, functions that require parameters of type Node must receive a value that is known at SHIPTide time, not a value that is dynamically assigned at run time. For example, the following statement will fail:

getChildIndex(getChild(myParent, index));    // fails instead of returning index

The above code is illegal since getChildIndex expects a static reference to a node, not one created at runtime through the getChild function.