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

# for — For loop

The FOR construct is a control flow structure for arithmetic progression, enumerating values of a given numeric range.

On each loop iteration, the embedded code is executed with the loop counter assigned to 'var'.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Variable name for loop counter |
| from | int |  | From |
| to | int |  | To |
| step | int | 1 | Step |

### Children
- (none)

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

### Result
- (none documented)

### Examples

```xml
<for var="count" from="6" to="10" step="2">
	<output>$count&n;</output>
</for>

<!--
6
8
10
-->
```

```xml
<for var="count" from="10" to="6" step="2">
	<output>$count&n;</output>
</for>

<!--
10
8
6
-->
```
