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

# call — Call function

CALL breaks out of the current control flow and continues with the execution of a function. It then returns to its original control flow. Arguments may be passed to local variables as parameters on switch of context.

A function can be coded so that it may call itself recursively. This technique allows direct implementation of functions defined by mathematical induction and recursive divide and conquer algorithms.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| func | var |  | Function variable name |
| var | var |  | Result variable name |
| var_params | var |  | Variable name for associated parameter name and value pairs |
| var_this | var |  | Variable name for explicit rebinding of 'this' |

### Children
- (none)

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

### Result
- binding: var; type: n/a

### Examples

```xml
<global var="name"/>

<function var="outputName">
	<output>$name</output>
</function>

<set var="name">iXML</set>
<call func="outputName"/>

<!-- iXML -->
```

```xml
<function var="outputName">
	<output>$name</output>
</function>

<call func="outputName">
	<param name="name">iXML</param>
</call>

<!-- iXML -->
```

```xml
<set var="obj.name">iXML</set>

<function var="obj.outputName">
	<output>$this.name</output>
</function>

<call func="obj.outputName"/>

<!-- iXML -->
```

```xml
<function var="getName">
	<set var="return">iXML</set>
	<return/>
	<set var="return">XML</set>
</function>

<call func="getName" var="name"/>
<output>$name</output>

<!-- iXML -->
```

```xml
<function var="outputName">
	<output>$name&n;</output>
</function>

<array var="names">
	<item>Bill Gates</item>
	<item>Steve Jobs</item>
</array>

<foreach var="names" var_value="name">
	<call func="outputName">
		<param name="name">$name</param>
	</call>
</foreach>

<!--
Bill Gates
Steve Jobs
-->
```

```xml
<set var="count">1</set>

<function var="output">
	<use var="count"/>

	<output>$count&n;</output>
	<math:inc var="count"/>
</function>

<for from="1" to="5">
	<call func="output"/>
</for>

<!--
1
2
3
4
5
-->
```

```xml
<soap:client wsdl="http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL">
	<soap:bind var="getCountryName">CountryName</soap:bind>
</soap:client>

<array var="parameters">
	<item key="sCountryISOCode">DE</item>
</array>

<call func="getCountryName" var="result">
	<param var="parameters"/>
</call>

<output>$result.CountryNameResult</output>

<!-- Germany -->
```

```xml
<rest:client url="https://api.predic8.de/shop/v2">
	<rest:header>
		Content-Type: application/json
	</rest:header>

	<rest:bind var="createProduct" method="POST">/products/</rest:bind>
	<rest:bind var="updateProduct" method="PATCH">/products/:id</rest:bind>
	<rest:bind var="getProduct" method="GET">/products/:id</rest:bind>
</rest:client>

<call func="createProduct" var="data">
	<param>{"name": "Some Fruit", "price": 4.99}</param>
</call>

<call func="updateProduct">
	<param var="data.id"/>
	<param>{"name": "Wildberries"}</param>
</call>

<call func="getProduct" var="data">
	<param var="data.id"/>
</call>

<output>$data.name</output>

<!-- Wildberries -->
```
