{"name":"breakWith","title":"breakWith","type":"command","url":"https://community.bistudio.com/wiki/breakWith","revid":349341,"updated":"2023-11-08T14:53:30Z","groups":["Program Flow"],"status":"ok","games":{"arma3":"2.02"},"since":"arma3 2.02","arma3_since":"2.02","description":"Skips all loop iterations and immediately returns the given value.","syntaxes":[{"syntax":"breakWith return","params":[{"name":"return","type":"Anything","description":"value to be returned when iterations are skipped","type_expr":"Anything"}],"returns":{"type":"Anything","type_expr":"Anything"},"form":"unary","right":{"text":"return"}}],"examples":[{"text":"```sqf\n// stops once _i reaches 5 and outputs 0, 1, 2, 3, 4, END\nsystemChat call {\n    for \"_i\" from 0 to 10 do {\n        if (_i == 5) then { breakWith \"END\"; };\n        systemChat str _i;\n    };\n};\n```","code":["// stops once _i reaches 5 and outputs 0, 1, 2, 3, 4, END\nsystemChat call {\n\tfor \"_i\" from 0 to 10 do {\n\t\tif (_i == 5) then { breakWith \"END\"; };\n\t\tsystemChat str _i;\n\t};\n};"]}],"see_also":["continueWith","break","continue","breakOut"]}