---
name: "Expression"
type: topic
aliases: ["expression"]
source: https://community.bistudio.com/wiki/Expression
revid: 337051
updated: 2023-01-10T14:32:59Z
---

# Expression

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

### Expression Types

An expression can be:

- [variable](../topics/Variables.md)
- [operation](../topics/Operators.md)
- scripting command
- [control structure](../topics/Control_Structures.md)

#### Variable

An expression can be a simple [variable](../topics/Variables.md) ([identifier](../topics/Identifier.md)):

**Examples:**

```sqs
_myVariable
globalVariable
```

#### Operation

An expression can be an [operation](../topics/Operators.md) including its operands.

**Examples:**

```sqs
5 * 6
a % 2
b * c
```

#### Scripting Command

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

**Examples:**

```sqs
count myArray
position unit1
```

#### Control Structure

An expression can be a [control structure](../topics/Control_Structures.md) returning a value.

**Examples:**

```sqs
; returns myValueA or myValueB
if (myCondition) then { myValueA } else { myValueB }
```

<sub>Source: [BI Community Wiki — Expression](https://community.bistudio.com/wiki/Expression) (revision 337051).</sub>
