---
name: "SQS Syntax"
type: topic
aliases: ["?", "@", "SQS", "SQS syntax", "sqs", "sqs syntax"]
source: https://community.bistudio.com/wiki/SQS_Syntax
revid: 330355
updated: 2022-09-02T20:27:41Z
---

# SQS Syntax

[SQS Syntax](../topics/SQS_Syntax.md) (where SQS stands for Status Quo Script) was the main syntax in Operation Flashpoint and is still available (although considered obsolete) in later titles. It can only be used for [scripts](../topics/Script_File.md), but not for [functions](../topics/Function.md), in the Mission Editor or in addon config files. The newer script syntax is [SQF Syntax](../topics/SQF_Syntax.md).

### Rules

Binding rules:

- [Statements](../topics/Statement.md) are separated by **line breaks**, **semicolons** (;) and **commas** (,) - this means that a statement *can not* span over multiple lines (e.g a [switch](../commands/switch.md) usage must be all inlined).
- A [code block](../topics/Code.md) (defined by curled braces `{ }`) is considered a single statement, thus may not span over multiple lines either.

#### Example

```
STATEMENT 1
STATEMENT 2; STATEMENT 3, STATEMENT 4

BLOCK { STATEMENT 5; STATEMENT 6 }
```

### Comments

A line beginning with a **semicolon** (`;`) is considered a comment and ignored by the game engine.

#### Example

```sqs
; this is my comment
```

### Language Constructs

The control structures listed in the article [Control Structures](../topics/Control_Structures.md) may also be used in SQS syntax. Note that they must be written **within a single line** due to the above rules.

**Example**

```sqs
if (_value == 1) then { hint "Value is 1" } else { hint "Value is not 1" }
```

There exist also special structures limited to SQS syntax, listed below.

#### Tilde

The tilde (`~`) symbol tells the script to wait X amount of seconds (see [sleep](../commands/sleep.md) in SQF):

```sqs
hint "3..."
~1
hint "2..."
~1
hint "1..."
~1
hint "GO!"
```

#### Label

Labels may be defined in the code by beginning a line with `#`, followed by the label's name (without spaces).
The [goto](../commands/goto.md) command can then be used at any point of the [script](../topics/Script_File.md) to jump to this label (and potentially create a loop).

```sqs
#Label1

~1
hint format ["a second has passed. time: %1", round time]

goto "Label1"
```

#### Conditional

A [Boolean](../topics/Boolean.md) condition can be used in order to run code that is executed *only* when said condition is `true`. Note that there is no such equivalent for "[else](../commands/else.md)".
A conditional line must start with `?`, followed by the condition and `:`, followed by one or more commands. Multiple commands are separated by commas (,) or semicolons (;).
The conditional statement, like other statements, ends with the end of the line.

```sqs
? alive target : hint "target is alive, let's destroy it"; target setDammage 1
```

#### @

Much like the [waitUntil](../commands/waitUntil.md) statement in [SQF Syntax](../topics/SQF_Syntax.md), @ will evaluate a certain condition, and the script will pause until @ returns [true](../commands/true.md).

```sqs
@not alive target
```

### Notes

Due to the line-based nature of [SQS scripts](../topics/SQS_Syntax.md), it is not possible to create multiline string constants in them.
To overcome this limitation multiline text can be stored in a separate text file and loaded using [loadFile](../commands/loadFile.md) or [preprocessFile](../commands/preprocessFile.md) (the second uses C-like preprocessor with // or /* */ comments and #define macros).

### Limitations

In Operation Flashpoint, if a single line of a sqs file is longer than 4096 characters, the game will return an error and will not execute the line.

### See also

- [SQF Syntax](../topics/SQF_Syntax.md)
- [Script File](../topics/Script_File.md)
- [Statement](../topics/Statement.md)
- [Block](../topics/Code.md)

<sub>Source: [BI Community Wiki — SQS Syntax](https://community.bistudio.com/wiki/SQS_Syntax) (revision 330355).</sub>
