---
name: "Code"
type: topic
aliases: ["Block"]
source: https://community.bistudio.com/wiki/Code
revid: 378166
updated: 2026-03-02T16:38:58Z
---

# Code

**Code** represents data consisting of commands and their parameters.
It is defined in script by being wrapped in `{`/`}` brackets, and is precompiled by the game engine.

The contents of [SQF](../topics/SQF_Syntax.md) and SQS files are Code.

Examples:

```sqf
while { alive player } do { sleep 1; hintSilent format ["Health: %1/100", round ((1 - damage player) * 100)]; };
unit addEventHandler ["Killed", { systemChat format ["%1 is dead", name (_this select 0)]; }];
onMapSingleClick { systemChat format ["You clicked at %1", _pos]; };
```

> [!NOTE]
> See Code vs. Strings for more information on code/string data typing.

<sub>Source: [BI Community Wiki — Code](https://community.bistudio.com/wiki/Code) (revision 378166).</sub>
