breakWith

From Bohemia Interactive Community
Jump to navigation Jump to search
Hover & click on the images for descriptions

Description

Description:
Skips all loop iterations and immediately returns the given value.

Syntax

Syntax:
breakWith return
Parameters:
return: Anything - Value to be returned when iterations are skipped
Return Value:
Anything

Examples

Example 1:
This loop will stop once _i reaches 5; the output will be "0", "1", "2", "3", "4" and finally "END". systemChat call { for "_i" from 0 to 10 do { if (_i == 5) then { breakWith "END"; }; systemChat str _i; }; };

Additional Information

See also:
continueWith break continue breakOut
Groups:
Program Flow

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