Issue #18, but syntax is: foreach (variable) => (expression) {...}.

This commit is contained in:
Marvin Blum
2015-10-31 16:40:58 +01:00
parent 3ee9a310e8
commit 6c55846e9f
6 changed files with 14 additions and 6 deletions

View File

@@ -86,8 +86,9 @@ for var _i = 0; _i < 100; _i = _i+1 { // var before identifier is optional
// ...
}
each allUnits { // foreach, iterates over all units in this case
// element is available as _x here
foreach unit => allUnits { // foreach, iterates over all units in this case
// element is available as "unit" here
// _x is still available due to how SQF works!
}
switch x { // there is no "break" in SQF
@@ -242,6 +243,7 @@ Keywords should not be used as identifiers. Here is a full list of all keywords
| exitwith |
| waituntil |
| code |
| in |
## What's missing?