SQS to SQF conversion: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Add sqf notrim) |
||
Line 22: | Line 22: | ||
|- | |- | ||
| <sqs>; This is a comment</sqs> | | <sqs>; This is a comment</sqs> | ||
<sqs> | <sqs notrim> | ||
; This is a | ; This is a | ||
; multiline | ; multiline | ||
; comment | ; comment | ||
</sqs> | </sqs> | ||
<sqs>comment "this is a comment";</sqs> | <sqs>comment "this is a comment";</sqs> | ||
Line 77: | Line 77: | ||
|- | |- | ||
| | | | ||
<sqs> | <sqs notrim> | ||
? CONDITION : goto "SKIP" | ? CONDITION : goto "SKIP" | ||
COMMAND_2 | COMMAND_2 | ||
Line 85: | Line 85: | ||
#END | #END | ||
</sqs> | |||
| | | | ||
<sqf> | <sqf> | ||
Line 125: | Line 126: | ||
? _i < COUNT : goto "LOOP" | ? _i < COUNT : goto "LOOP" | ||
</sqs> | </sqs> | ||
| <sqf> | | <sqf notrim> | ||
for "_i" from 0 to COUNT -1 do { | for "_i" from 0 to COUNT -1 do { | ||
COMMAND; | COMMAND; | ||
}; | }; | ||
</sqf> | |||
|- | |- | ||
! colspan="2" | | ! colspan="2" | |
Revision as of 14:43, 15 July 2022
SQF Syntax has been introduced in Operation Flashpoint: Resistance v1.85 and is the Arma series' main scripting language since. The main differences with SQS Syntax are:
- execVM is used (instead of exec for SQS)
- Every command has to end with a semicolon (;)
- the following commands disappeared:
- Line returns do not impact code
- SQF can return a variable, where SQS cannot
Conversion examples
SQS | SQF |
---|---|
Comment | |
; This is a comment
; This is a
; multiline
; comment
comment "this is a comment"; "this is a comment"; |
// This is single-line comment /*
This is a
multiline
comment
*/ comment "this is a comment"; "this is a comment"; |
Condition wait | |
@CONDITION |
|
Delay | |
~DELAY ~5 |
sleep DELAY; sleep 5; |
Conditional command | |
Multi-conditional command | |
Cycle | |
Cycle with step | |
Structured conditional command | |
Exiting | |