Jump to content

API Component.Clone: Difference between revisions

From Flowcode Help
JonnyW (talk | contribs)
XML import
No edit summary
Line 1: Line 1:
<sidebar>API Contents</sidebar>
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
Clones an existing object to another position on the panel
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
<div style="width:25%; float:right" class="toc">
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Clone'''
====Class hierarchy====
|-
[[API Component|Component]]
| colspan="2" | Clones an existing object to another position on the panel&nbsp;
:[[API Component|Clone]]
|-
</div>
|-
__TOC__
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | Source
==Parameters==
|-
[[Variable Types|HANDLE]] ''Source''
| colspan="2" | The object to copy&nbsp;
:The object to copy
|-
 
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
[[Variable Types|HANDLE]] ''DestParent''
| width="90%" | DestParent
:The parent to link the cloned object to
|-
 
| colspan="2" | The parent to link the cloned object to&nbsp;
[[Variable Types|HANDLE]] ''NewPosition''
|-
:A position to move the object to
| width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE
 
| width="90%" | NewPosition
 
|-
==Return value==
| colspan="2" | A position to move the object to&nbsp;
[[Variable Types|HANDLE]]
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-h32-icon.png]] - HANDLE
A handle to the newly created component, 0 if the call failed.
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}





Revision as of 11:41, 16 January 2023

Clone
Clones an existing object to another position on the panel 
- HANDLE Source
The object to copy 
- HANDLE DestParent
The parent to link the cloned object to 
- HANDLE NewPosition
A position to move the object to 
- HANDLE Return


Detailed description

This creates an identical copy of the object which may be inserted at any point in the component tree.


The root object may not be cloned, but other to that any object (even a definition) may be cloned.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Component.Clone(source, destparent, newposition)

No additional examples