Expression: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOC|side}} | |||
An '''expression''' is a piece of code that returns a value. | An '''expression''' is a piece of code that returns a value. | ||
== Types | |||
== Expression Types == | |||
An expression can be: | An expression can be: | ||
* [[Variables|variable]] | * [[Variables|variable]] | ||
* [[ | * [[Operators|operation]] | ||
* [[:Category:Scripting Commands|scripting command]] | * [[:Category:Scripting Commands|scripting command]] | ||
* [[Control Structures|control structure]] | * [[Control Structures|control structure]] | ||
Line 12: | Line 14: | ||
=== Variable === | === Variable === | ||
An expression can be a simple [[Variables|variable]]: | An expression can be a simple [[Variables|variable]] ([[identifier]]): | ||
'''Examples:''' | '''Examples:''' | ||
<sqs> | |||
_myVariable | |||
globalVariable | |||
</sqs> | |||
=== Operation === | === Operation === | ||
An expression can be an [[ | An expression can be an [[Operators|operation]] including its [[Operand|operands]]. | ||
'''Examples:''' | '''Examples:''' | ||
<sqs> | |||
5 * 6 | |||
a % 2 | |||
b * c | |||
</sqs> | |||
=== Scripting Command === | === Scripting Command === | ||
Line 35: | Line 41: | ||
'''Examples:''' | '''Examples:''' | ||
<sqs> | |||
count myArray | |||
position unit1 | |||
</sqs> | |||
=== Control Structure === | === Control Structure === | ||
Line 44: | Line 52: | ||
'''Examples:''' | '''Examples:''' | ||
<sqs> | |||
; returns myValueA or myValueB | |||
if (myCondition) then { myValueA } else { myValueB } | |||
</sqs> | |||
[[Category: | [[Category: Syntax]] | ||
Latest revision as of 15:32, 10 January 2023
An expression is a piece of code that returns a value.
Expression Types
An expression can be:
Variable
An expression can be a simple variable (identifier):
Examples:
_myVariable
globalVariable
Operation
An expression can be an operation including its operands.
Examples:
Scripting Command
An expression can be a scripting command returning a value including its arguments.
Examples:
Control Structure
An expression can be a control structure returning a value.
Examples: