---
name: "SQS to SQF conversion"
type: topic
source: https://community.bistudio.com/wiki/SQS_to_SQF_conversion
revid: 377918
updated: 2026-01-11T15:31:56Z
---

# SQS to SQF conversion

[SQF Syntax](../topics/SQF_Syntax.md) has been introduced in Operation Flashpoint: Resistance v1.85 and is the Arma series' main scripting language until Arma 3.
The main differences with [SQS Syntax](../topics/SQS_Syntax.md) are:

- **[execVM](../commands/execVM.md)** is used (instead of [exec](../commands/exec.md) for SQS)
- Every command has to end with a semicolon (`;`)
- the following commands disappeared:
  - [goto](../commands/goto.md)/
    [#label](../topics/SQS_Syntax.md#label) (Note, [#](../commands/a_hash_b.md) is a command in itself in Arma 3)
  - [exit](../commands/exit.md) - a partial SQF equivalent can be found in [exitWith](../commands/exitWith.md)
- Line returns do not impact code
- SQF can return a variable, where SQS cannot

### Conversion Examples

| SQS | SQF |
|---|---|
| **Comment** |  |
| `; This is a comment`<br>```sqs<br>; This is a<br>; multiline<br>; comment<br>```<br>`comment "this is a comment";`<br>`"this is a comment";` | `// This is single-line comment`<br>```sqf<br>/*<br>    This is a<br>    multiline<br>    comment<br>*/<br>```<br>`comment "this is a comment";`<br>`"this is a comment";` |
| **Conditional Wait** |  |
| `@CONDITION`<br>`@ not alive player` | `waitUntil { CONDITION };`<br>`waitUntil { not alive player };` |
| **Delay** |  |
| `~DELAY`<br>`~5` | `sleep DELAY;`<br>`sleep 5;` |
| **Conditional Command** |  |
| `? CONDITION : COMMAND`<br>`? alive player : player setDammage 1` | `if (CONDITION) then { COMMAND };`<br>`if (alive player) then { player setDammage 1 };` |
| **Multi-Conditional Command** |  |
| ```sqs<br>? CONDITION : goto "SKIP"<br> COMMAND_2<br>goto "END"<br>#SKIP<br> COMMAND_1<br>#END<br>``` | ```sqf<br>if (CONDITION) then<br>{<br>    COMMAND_1<br>}<br>else<br>{<br>    COMMAND_2<br>};<br>``` |
| **Cycle** |  |
| ```sqs<br>#loop<br>COMMAND<br>~DELAY<br>? CONDITION : goto "LOOP"<br>``` | ```sqf<br>while { CONDITION } do<br>{<br>    COMMAND;<br>    sleep DELAY;<br>};<br>``` |
| **Cycle With Step** |  |
| ```sqs<br>_i = 0<br>#LOOP<br> COMMAND<br> _i = _i + 1;<br>? _i < COUNT : goto "LOOP"<br>``` | ```sqf<br>for "_i" from 0 to COUNT -1 do<br>{<br>    COMMAND;<br>};<br>``` |
| **Structured Conditional Command** |  |
| ```sqs<br>? VARIABLE == VALUE_1: goto "SKIP_1"<br>? VARIABLE == VALUE_2: goto "SKIP_2"<br> DEFAULT_COMMAND<br> goto "END"<br>#SKIP_1<br> COMMAND_1<br> goto "END"<br>#SKIP_2<br> COMMAND_2<br>#END<br>``` | ```sqf<br>switch (VARIABLE) do<br>{<br>    case VALUE_1:<br>        { COMMAND_1 };<br>    case VALUE_2:<br>        { COMMAND_2 };<br>    default<br>        { DEFAULT_COMMAND };<br>};<br>``` |
| **Exiting** |  |
| ```sqs<br>? CONDITION : COMMAND_2<br>? CONDITION : exit<br> COMMAND_1<br>``` | ```sqf<br>if (CONDITION) exitWith { COMMAND_2; };<br>COMMAND_1;<br>``` |

### See Also

- [SQF Syntax](../topics/SQF_Syntax.md)
- [SQS Syntax](../topics/SQS_Syntax.md)
- [Introduction to Arma Scripting](../topics/Introduction_to_Arma_Scripting.md)

<sub>Source: [BI Community Wiki — SQS to SQF conversion](https://community.bistudio.com/wiki/SQS_to_SQF_conversion) (revision 377918).</sub>
