{"name":"Code","title":"Code","type":"topic","url":"https://community.bistudio.com/wiki/Code","revid":378166,"updated":"2026-03-02T16:38:58Z","aliases":["Block"],"markdown":"**Code** represents data consisting of commands and their parameters.\nIt is defined in script by being wrapped in `{`/`}` brackets, and is precompiled by the game engine.\n\nThe contents of SQF and SQS files are Code.\n\nExamples:\n\n```sqf\nwhile { alive player } do { sleep 1; hintSilent format [\"Health: %1/100\", round ((1 - damage player) * 100)]; };\nunit addEventHandler [\"Killed\", { systemChat format [\"%1 is dead\", name (_this select 0)]; }];\nonMapSingleClick { systemChat format [\"You clicked at %1\", _pos]; };\n```\n\n> [!NOTE]\n> See Code vs. Strings for more information on code/string data typing.","sections":[{"heading":null,"level":1,"markdown":"**Code** represents data consisting of commands and their parameters.\nIt is defined in script by being wrapped in `{`/`}` brackets, and is precompiled by the game engine.\n\nThe contents of SQF and SQS files are Code.\n\nExamples:\n\n```sqf\nwhile { alive player } do { sleep 1; hintSilent format [\"Health: %1/100\", round ((1 - damage player) * 100)]; };\nunit addEventHandler [\"Killed\", { systemChat format [\"%1 is dead\", name (_this select 0)]; }];\nonMapSingleClick { systemChat format [\"You clicked at %1\", _pos]; };\n```\n\n> [!NOTE]\n> See Code vs. Strings for more information on code/string data typing."}],"categories":["Data Types"],"groups":["Data Types"]}