Code: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " (={2,})([^ = ])(.*)([^ = ])(={2,}) * " to " $1 $2$3$4 $5 ") |
Lou Montana (talk | contribs) |
||
Line 1: | Line 1: | ||
'''Code''' represents data consisting of commands and their parameters. The contents of [[sqf]] and [[ | '''Code''' represents data consisting of commands and their parameters. The contents of [[sqf]] and [[SQS Syntax|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, e.g. [[for]] {Code} [[do]] {Code}; unit [[addEventHandler]] [Event Handler type, {Code}]; [[onMapSingleClick]] "Code". | ||
Code literals are usually represented by enclosing text into curly braces: '{' and '}'. Any such code is precompiled by the script engine. Sometimes it may become necessary to first read in certain commands as String. In order to convert code from data type String into data type Code, the command [[compile]] can be used. See [[Code vs. Strings]] for more information on code data typing. | Code literals are usually represented by enclosing text into curly braces: '{' and '}'. Any such code is precompiled by the script engine. Sometimes it may become necessary to first read in certain commands as String. In order to convert code from data type String into data type Code, the command [[compile]] can be used. See [[Code vs. Strings]] for more information on code data typing. |
Revision as of 23:08, 24 March 2021
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, e.g. for {Code} do {Code}; unit addEventHandler [Event Handler type, {Code}]; onMapSingleClick "Code".
Code literals are usually represented by enclosing text into curly braces: '{' and '}'. Any such code is precompiled by the script engine. Sometimes it may become necessary to first read in certain commands as String. In order to convert code from data type String into data type Code, the command compile can be used. See Code vs. Strings for more information on code data typing.