Expression: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
Line 6: Line 6:


* [[Variables|variable]]
* [[Variables|variable]]
* [[Operations|operation]]
* [[Operators|operation]]
* [[:Category:Scripting Commands|scripting command]]
* [[:Category:Scripting Commands|scripting command]]
* [[Control Structures|control structure]]
* [[Control Structures|control structure]]
Line 21: Line 21:
=== Operation ===
=== Operation ===


An expression can be an [[Operations|operation]] including its [[Operand|operands]].
An expression can be an [[Operators|operation]] including its [[Operand|operands]].


'''Examples:'''
'''Examples:'''

Revision as of 00:32, 22 December 2006

An expression is a piece of code that returns a value.

Types of Expressions

An expression can be:

Variable

An expression can be a simple variable:

Examples:

_myVariable
globalVariable

Operation

An expression can be an operation including its operands.

Examples:

5 * 6
a % 2
b * c

Scripting Command

An expression can be a scripting command returning a value including its arguments.

Examples:

count myArray
position unit1

Control Structure

An expression can be a control structure returning a value.

Examples:

if (myCondition) then {myValueA} else {myValueB}

=> returns myValueA or myValueB