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

# 0120: Expected calling convention type

Compiler expected a valid name of a [foreign function](/language/functions.md#foreign-functions)'s calling convention but found something else.

A foreign function (a declaration-only function pointing to a memory address in the game) must define the calling convention (can be either `cdecl`, `stdcall`, or `thiscall`) for the compiler to correctly pick the opcode when this function is called.

```pascal
function CStats__GetStatType<0x558E30>(statId: int): int // error: expected calling convention type (cdecl, stdcall, or thiscall), found 0x558E30.
```

#### Possible solutions:

* check your function definition and provide a correct name of the calling convention after `<:`

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

Refer to [foreign function](/language/functions.md#foreign-functions) documentation to find list of available conventions and difference between them
