continueWith: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " |arma3dev |2.01" to " |arma3 |2.02") |
(Added example) |
||
Line 1: | Line 1: | ||
{{RV|type=command | {{RV|type=command | ||
|arma3 | |game1= arma3 | ||
|2.02 | |version1= 2.02 | ||
|gr1= Program Flow | |gr1= Program Flow | ||
| Skips current loop iteration | |descr= Skips the current loop iteration, continues with the next one and returns the given value. | ||
| [[continueWith]] return | |s1= [[continueWith]] return | ||
|p1= return: [[Anything]] - Value to be returned when iteration is skipped | |p1= return: [[Anything]] - Value to be returned when iteration is skipped | ||
| [[Anything]] | |r1= [[Anything]] | ||
|x1= | |x1= The result of this code will be {{ic|[2, "TEST", 4]}}. | ||
<code>[1, 2, 3] [[apply]] { | |||
[[if]] (_x == 2) [[then]] { | |||
[[continueWith]] "TEST"; | |||
} [[else]] { | |||
_x + 1 | |||
}; | |||
};</code> | |||
|seealso= [[continue]] [[break]] [[breakWith]] | |seealso= [[continue]] [[break]] [[breakWith]] | ||
}} | }} |
Revision as of 18:48, 3 March 2021
Description
- Description:
- Skips the current loop iteration, continues with the next one and returns the given value.
- Groups:
- Program Flow
Syntax
- Syntax:
- continueWith return
- Parameters:
- return: Anything - Value to be returned when iteration is skipped
- Return Value:
- Anything
Examples
- Example 1:
- The result of this code will be
[2, "TEST", 4]
.[1, 2, 3] apply { if (_x == 2) then { continueWith "TEST"; } else { _x + 1 }; };
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note