Code: Difference between revisions
mNo edit summary |
(Clarified.) |
||
Line 1: | Line 1: | ||
'''Code''' is a | '''Code''' is a "value" representing some functionality or calculation. Often is it passed as an argument into some scripting commands which will execute it straight away, or at some later some, e.g. [[call]], [[addEventHandler]] or [[onMapSingleClick]]. | ||
The text body that makes up '''Code''' are also scripting commands. | |||
'''Code''' literals are represented by enclosing text into curly braces. '''{''' code.... '''}''' Any such code is precompiled by the script engine. Code values may also originate as a text, which can be converted to code using [[compile]] command. | |||
[[ArmA|Armed Assault]] formalised this 'convention' by creating a Code '''Type'''. In previous versions it was a prefered style to write such strings in curled braces, but it was also possible to write them in quotation marks (exactly like [[String]]s). ArmA commands that are marked as requiring '''Code''' must be presented with curled braces. Resistance / Cold War crisis commands using a '''Code''' style paramater should ''also'' used curled brace as a good writing style that was adopted very early on by most mission makers. | [[ArmA|Armed Assault]] formalised this 'convention' by creating a Code '''Type'''. In previous versions it was a prefered style to write such strings in curled braces, but it was also possible to write them in quotation marks (exactly like [[String]]s). ArmA commands that are marked as requiring '''Code''' must be presented with curled braces. Resistance / Cold War crisis commands using a '''Code''' style paramater should ''also'' used curled brace as a good writing style that was adopted very early on by most mission makers. |
Revision as of 22:54, 5 September 2007
Code is a "value" representing some functionality or calculation. Often is it passed as an argument into some scripting commands which will execute it straight away, or at some later some, e.g. call, addEventHandler or onMapSingleClick.
The text body that makes up Code are also scripting commands.
Code literals are represented by enclosing text into curly braces. { code.... } Any such code is precompiled by the script engine. Code values may also originate as a text, which can be converted to code using compile command.
Armed Assault formalised this 'convention' by creating a Code Type. In previous versions it was a prefered style to write such strings in curled braces, but it was also possible to write them in quotation marks (exactly like Strings). ArmA commands that are marked as requiring Code must be presented with curled braces. Resistance / Cold War crisis commands using a Code style paramater should also used curled brace as a good writing style that was adopted very early on by most mission makers.