Code: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (→‎Introduction: better explanation?)
Line 1: Line 1:
==Introduction==
==Introduction==


The '''Code''' type was introduced with [[ArmA|Armed Assault]], type '''Code''' does not refer to ''Cold War Crisis'' or ''Resistance''. In previous versions it was a prefered style to write such strings in curled braces, but it was not required: it was also possible to write them in quotation marks (like [[String]]s). With ArmA functions that are marked as requiring '''Code''' must be presented with curled braces.


'''Code''' is a string like <u>paramater</u> passed or used by '''some''' of the scripting commands. [[addEventHandler|AddEventHandler]] eg [[onMapSingleClick|OnMapSingleClick]] eg.
The text body that makes up '''Code''' are also scripting commands.  Eg commands that will be executed 'at some time'.
'''Code''' should be represented by enclosing curly brace. '''{''' code.... '''}'''
[[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 functions that are marked as requiring '''Code''' must be presented with curled braces.


==Description==
==Description==

Revision as of 00:34, 5 September 2007

Introduction

Code is a string like paramater passed or used by some of the scripting commands. AddEventHandler eg OnMapSingleClick eg.


The text body that makes up Code are also scripting commands. Eg commands that will be executed 'at some time'.


Code should be represented by enclosing curly brace. { code.... }


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 functions that are marked as requiring Code must be presented with curled braces.

Description

Part of code (compiled), in curled braces:


Examples

{_x setDamage 1} forEach ArrayToKill