# 0118: Unexpected value to return

Compiler found a value that can't be [returned from a function](/language/functions.md#return-from-function). Functions can only return numbers (integer or float), strings, or single variables. Arrays or other complex values are not supported. Also, you can't put random words after `return` keyword:

```pascal
function foo  
    return value // Error: Unexpected value to return: value
end
```

#### Possible solutions:

* for each corresponding return type, provide a correct value that is either a number or a string, or a variable of the same type

```pascal
function foo
  return 42
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/0118.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.
