# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sannybuilder.com/troubleshooting/errors/0023.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
