---
title: "clone — Clone variable"
description: "iXML command clone: Clone variable."
canonical_url: "https://www.zeyos.com/ixml/ref/clone"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/clone.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# clone — Clone variable

CLONE creates a shallow copy of the value of a variable independent of it's data type.

If the result variable 'var_result' is omitted, the resulting value will be stored in 'var' instead.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Variable name |
| var_result | var | (same as 'var') | Result variable name |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var_result; type: array; predicate: no-result-propagation

### Examples

```xml
<array var="original">
	<item>Bill Gates</item>
	<item>Steve Jobs</item>
</array>

<clone var="original" var_result="new"/>
<set var="new[1]">Larry Ellison</set>

<output>$original[1] and $new[1] are friends!</output>

<!-- Steve Jobs and Larry Ellison are friends! -->
```
