SQS to SQF conversion
From Bohemia Interactive Community
Contents |
[edit]
What's different in SQF
- Every command has to end with semicolon.
- SQF does not have a goto command anymore.
- SQF commands can span several lines if they are enclosed in brackets.
- SQF can return a variable, where SQS cannot.
[edit]
Replacing
[edit]
Comment
| SQS |
; This is a comment |
| SQF |
// This is single-line comment /* This is multiline comment */ comment "And this is a comment working both in SQS and SQF"; |
[edit]
Condition
| SQS |
@CONDITION |
| SQF |
waitUntil {CONDITION}; |
[edit]
Delay
| SQS |
~DELAY |
| SQF |
sleep DELAY; |
[edit]
Conditional command
| SQS |
?CONDITION: COMMAND |
| SQF |
[edit]
Multi-conditional command
| SQS |
| SQF |
if (CONDITION) then {COMMAND_1} else {COMMAND_2}; |
[edit]
Cycle
| SQS |
#loop COMMAND ~DELAY ?CONDITION: goto "LOOP" |
| SQF |
[edit]
Cycle with step
| SQS |
_n = 0 #LOOP COMMAND _n = _n + 1; ?_n < COUNT: goto "LOOP" |
| SQF |
for [{_n = 0},{_n <= COUNT},{_n = _n+1}] do {
COMMAND;
};
|
[edit]
Structured conditional command
| SQS |
| SQF |
[edit]
Exiting
| SQS |
?CONDITION: goto "Exit" COMMAND_1 #Exit COMMAND_2 exit |
| SQF |

