> For the complete documentation index, see [llms.txt](https://docs.sannybuilder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sannybuilder.com/troubleshooting/errors/0022.md).

# 0022: Loop counter is not a variable

The compiler finds that a `FOR` [loop](/language/control-flow/loops.md#for-end)'s counter is not a [variable](/language/data-types/variables.md).

**Possible solutions:** use a variable as the counter of the loop iterations:

```
FOR $MyCounter = 1 to 10

END
```
