Difference between revisions of "API Component.GetOriginal"

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>
==ComponentGetOriginal==
+
Gets the original definition of the component, returns Current if no original copy
  
Gets the original definition of the component, returns Current if no original copy
+
<div style="width:25%; float:right" class="toc">
----
+
====Class hierarchy====
 +
[[API Component|Component]]
 +
:[[API Component|GetOriginal]]
 +
</div>
 +
__TOC__
  
===Parameters===
+
==Parameters==
''[[Variable types|HANDLE]] Current''
+
[[Variable Types|HANDLE]] ''Current''
 
:The component to find the definition of
 
:The component to find the definition of
  
===Return value===
+
 
[[Variable types|HANDLE]]
+
==Return value==
 +
[[Variable Types|HANDLE]]
  
 
Returns the original definition of the component, returns Current if no original copy
 
Returns the original definition of the component, returns Current if no original copy
  
===Detailed description===
 
''No additional information''
 
  
===Examples===
+
==Detailed description==
====Calling in a calculation:====
+
When a compiled component is loaded into Flowcode it is stored as a ''definition'' and a copy made, which is the actual component that is shown by the system. The original definition copy is used to create new instances of the loaded component.
 +
 
 +
 
 +
This call retrieves a handle to that definition. It may not be deleted or re-linked but otherwise can be treated as any other component and its properties may be read or set.
 +
 
 +
 
 +
Note that modifying the contents of this component or its children will affect subsequent copies added to the system, as they will be cloned from this template.
 +
 
 +
 
 +
==Examples==
 +
===Calling in a calculation===
 
* Declare a variable 'result' of type HANDLE
 
* Declare a variable 'result' of type HANDLE
* Add to a calculation icon: result = ::Component.GetOriginal(current)
+
* Add to a calculation icon: <pre class="brush:[cpp]">result = ::Component.GetOriginal(current)</pre>
 +
 
 +
''<span style="color:red;">No additional examples</span>''

Latest revision as of 15:57, 16 January 2014

<sidebar>API Contents</sidebar> Gets the original definition of the component, returns Current if no original copy

Class hierarchy

Component

GetOriginal

Parameters

HANDLE Current

The component to find the definition of


Return value

HANDLE

Returns the original definition of the component, returns Current if no original copy


Detailed description

When a compiled component is loaded into Flowcode it is stored as a definition and a copy made, which is the actual component that is shown by the system. The original definition copy is used to create new instances of the loaded component.


This call retrieves a handle to that definition. It may not be deleted or re-linked but otherwise can be treated as any other component and its properties may be read or set.


Note that modifying the contents of this component or its children will affect subsequent copies added to the system, as they will be cloned from this template.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Component.GetOriginal(current)

No additional examples