{"name":"breakWith","operator":null,"title":"breakWith","type":"command","url":"https://community.bistudio.com/wiki/breakWith","revid":349341,"updated":"2023-11-08T14:53:30Z","groups":["Program Flow"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.02"}],"since":{"game":"arma3","name":"Arma 3","version":"2.02"},"arma3_since":"2.02","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Skips all loop iterations and immediately returns the given value.","syntaxes":[{"syntax":"breakWith return","since":null,"effect":null,"exec":null,"params":[{"name":"return","type":"Anything","optional":false,"default":null,"description":"value to be returned when iterations are skipped","types":["Anything"],"since":null,"text":"return: Anything - value to be returned when iterations are skipped"}],"returns":{"type":"Anything","types":["Anything"],"description":null,"text":"Anything"},"form":"unary","operator":null,"left":null,"right":{"text":"return","types":["Anything"]}}],"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};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["continueWith","break","continue","breakOut"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Program Flow","Introduced with Arma 3 version 2.02","Scripting Commands"]}