breakWith: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|game([0-9]) ?= (.+) \|version([0-9]) ?= (.+) " to "|game$1= $2 |version$3= $4 ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 14: | Line 14: | ||
|r1= [[Anything]] | |r1= [[Anything]] | ||
|x1= | |x1= <sqf> | ||
// stops once _i reaches 5 and outputs 0, 1, 2, 3, 4, END | |||
systemChat call { | |||
for "_i" from 0 to 10 do { | |||
if (_i == 5) then { breakWith "END"; }; | |||
systemChat str _i; | |||
}; | }; | ||
};</ | }; | ||
</sqf> | |||
|seealso= [[continueWith]] [[break]] [[continue]] [[breakOut]] | |seealso= [[continueWith]] [[break]] [[continue]] [[breakOut]] | ||
}} | }} |
Revision as of 16:22, 4 May 2022
Description
- Description:
- Skips all loop iterations and immediately returns the given value.
- Groups:
- Program Flow
Syntax
- Syntax:
- breakWith return
- Parameters:
- return: Anything - Value to be returned when iterations are skipped
- Return Value:
- Anything
Examples
- Example 1:
Additional Information
- See also:
- continueWith break continue breakOut
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