# 0121: Expected function's static address

Compiler expected a static address of a [foreign function](/language/functions.md#foreign-functions) but found something else.

If the function address is known ahead of time, it can be included in the function definition so the compiler can use this address, when you call the function. It is an error to have a stray comma without an address:

```pascal
function CStats__GetStatType<cdecl,>(statId: int): int // error: Expected function's static address, found >.
```

#### Possible solutions:

* check documentation on foreign function syntax and provide the address inside angle brackets:

```pascal
function CStats__GetStatType<cdecl,0x558E30>(statId: int): int // static foreign function
```

* If the address is not known at compile time and can only be found in game, the address can be omitted:

```pascal
function CStats__GetStatType<cdecl>(statId: int): int
```

This function can only be called using a function pointer variable:

```pascal
CStats__GetStatType method // define a pointer to function Destroy
...
method = 0x400000 // function is located at 0x400000
int value = method(0xDEADD0D0) // call function using the pointer
```


---

# 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/0121.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.
