Difference between revisions of "API Component.GetInstance"

From Flowcode Help
Jump to navigationJump to search
(XML import)
(XML import)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The start line of the article
+
<sidebar>API Contents</sidebar>
==ComponentGetInstance==
+
Gets the type-instance of the component, >= 1 is valid
  
Gets the type-instance of the component, >= 1 is valid
+
<div style="width:25%; float:right" class="toc">
----
+
====Class hierarchy====
 +
[[API Component|Component]]
 +
:[[API Component|GetInstance]]
 +
</div>
 +
__TOC__
  
===Parameters===
+
==Parameters==
''[[Variable types|HANDLE]] Target''
+
[[Variable Types|HANDLE]] ''Target''
 
:The component to read the instance from
 
:The component to read the instance from
 
:''The default value for this parameter is: '''''this'''
 
:''The default value for this parameter is: '''''this'''
  
===Return value===
+
 
[[Variable types|ULONG]]
+
==Return value==
 +
[[Variable Types|ULONG]]
  
 
Returns the type-instance of the component, >= 1 is valid
 
Returns the type-instance of the component, >= 1 is valid
  
===Detailed description===
 
''No additional information''
 
  
===Examples===
+
==Detailed description==
====Calling in a calculation:====
+
A components instance is a number referring to how many occurrences of a component exist before this one, including itself. The number is 1 if the component is the first of its type to be added.
 +
 
 +
 
 +
This instance number is irrespective of the depth of a component - a component of the same type as the ''Target'' is still considered even if it is embedded deep in some other components [[Component Tree|tree]].
 +
 
 +
 
 +
Note this call relies on a match of the components GUID, so built-in component types (such as shapes and groups) do not have an instance and it will return zero.
 +
 
 +
 
 +
==Examples==
 +
===Calling in a calculation===
 
* Declare a variable 'result' of type ULONG
 
* Declare a variable 'result' of type ULONG
* Add to a calculation icon: result = ::Component.GetInstance(target)
+
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Component.GetInstance(target)</pre>
 +
 
 +
''<span style="color:red;">No additional examples</span>''

Latest revision as of 15:57, 16 January 2014

<sidebar>API Contents</sidebar> Gets the type-instance of the component, >= 1 is valid

Class hierarchy

Component

GetInstance

Parameters

HANDLE Target

The component to read the instance from
The default value for this parameter is: this


Return value

ULONG

Returns the type-instance of the component, >= 1 is valid


Detailed description

A components instance is a number referring to how many occurrences of a component exist before this one, including itself. The number is 1 if the component is the first of its type to be added.


This instance number is irrespective of the depth of a component - a component of the same type as the Target is still considered even if it is embedded deep in some other components tree.


Note this call relies on a match of the components GUID, so built-in component types (such as shapes and groups) do not have an instance and it will return zero.


Examples

Calling in a calculation

  • Declare a variable 'result' of type ULONG
  • Add to a calculation icon:
    result = ::Component.GetInstance(target)

No additional examples