> For the complete documentation index, see [llms.txt](https://glados-6.gitbook.io/glados-uflang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glados-6.gitbook.io/glados-uflang/features/loops/for.md).

# For

## Creating a *for* loop

### Syntax

```csharp
for (<variable-declaration> ; <condition> ; <variable-update>) {
    <block>
}
```

#### Variables declaration: <a href="#variables-declaration" id="variables-declaration"></a>

* Classical variable declaration with syntax:

```groovy
<type> <variable-name> = <value>;
```

#### Condition: <a href="#condition" id="condition"></a>

* Classical condition to stop the for loop.

#### Variable update: <a href="#variable-update" id="variable-update"></a>

* Classical assigment to variable in for scope.

### Examples <a href="#examples" id="examples"></a>

```csharp
for (var i = 0; i < 10; i++) {
    <block>
}
```

You can also use *any* as the type for the variable declaration:

```csharp
for (var i = 0; i < 10; i++) {
    <block>
}
```

```csharp
for (; 1 == 1; ) {
    <block>
}
```
