> 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/0023.md).

# 0023: Unexpected instruction

The compiler finds an incorrect syntax. It could be an error in a `FOR` loop or a malformed variable declaration.

**Possible solutions:** check the documentation and provide the correct syntax:

[Variable declaration](/language/data-types/variables.md#declaring-a-variable-type):

```pascal
var <variable>: <type>
```

or

```pascal
var
  <variable>: <type>
end
```

`FOR` [loop syntax](https://docs.sannybuilder.com/troubleshooting/errors/pages/-M0zIvAUSuFdAoI0Jp_P#for..end):

```pascal
FOR <loop variable> = <initial value> TO/DOWNTO <final value> [step = 1]
  <the loop body>
END
```
