Code: Difference between revisions
Category: Data Types
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) (Remove String'ed code information, leave it for Code vs. Strings) |
||
| Line 1: | Line 1: | ||
'''Code''' represents data consisting of commands and their parameters. The contents of [[SQF Syntax|SQF]] and [[SQS Syntax|SQS]] files, for example are 'Code'. | '''Code''' represents data consisting of commands and their parameters. | ||
In turn, it can also be the case that one of the scripting commands gets passed further scripting commands | The contents of [[SQF Syntax|SQF]] and [[SQS Syntax|SQS]] files, for example are 'Code'. | ||
<sqf | In turn, it can also be the case that one of the scripting commands gets passed further scripting commands. 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]; }; | |||
</sqf> | |||
{{Feature|informative|See [[Code vs. Strings]] for more information on code/string data typing.}} | |||
[[Category: Data Types]] | [[Category: Data Types]] | ||
Revision as of 17:35, 2 March 2026
Code represents data consisting of commands and their parameters. The contents of SQF and SQS files, for example are 'Code'. In turn, it can also be the case that one of the scripting commands gets passed further scripting commands. Examples:
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]; };