{"name":"continueWith","title":"continueWith","type":"command","url":"https://community.bistudio.com/wiki/continueWith","revid":378202,"updated":"2026-03-12T15:42:26Z","groups":["Program Flow"],"status":"ok","games":{"arma3":"2.02"},"since":"arma3 2.02","arma3_since":"2.02","description":"Skips the current loop iteration, continues with the next one and returns the given value.","syntaxes":[{"syntax":"continueWith return","params":[{"name":"return","type":"Anything","description":"value to be returned when iteration is skipped","type_expr":"Anything"}],"returns":{"type":"Anything","type_expr":"Anything"},"form":"unary","right":{"text":"return"}},{"syntax":"scriptHandle continueWith code","since":"arma3 2.22","params":[{"name":"scriptHandle","type":"Script Handle","type_expr":"Script Handle"},{"name":"code","type":"Code","description":"Code to execute once the Promise has completed. The code will be executed in Unscheduled Environment.","type_expr":"Code"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"scriptHandle"},"right":{"text":"code"}},{"syntax":"scriptHandle continueWith [code, args]","since":"arma3 2.22","params":[{"name":"scriptHandle","type":"Script Handle","type_expr":"Script Handle"},{"name":"code","type":"Code","description":"Code to execute once the Promise has completed. The code will be executed in Unscheduled Environment.","type_expr":"Code"},{"name":"args","type":"Anything","description":"Arguments passed into code in _thisArgs variable","type_expr":"Anything"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"scriptHandle"},"right":{"text":"[code, args]"}}],"examples":[{"text":"```sqf\n// results in [2, \"TEST\", 4]\nprivate _result = [1, 2, 3] apply {\n    if (_x == 2) then {\n        continueWith \"TEST\";\n    } else {\n        _x + 1;\n    };\n};\n```","code":["// results in [2, \"TEST\", 4]\nprivate _result = [1, 2, 3] apply {\n\tif (_x == 2) then {\n\t\tcontinueWith \"TEST\";\n\t} else {\n\t\t_x + 1;\n\t};\n};"]}],"see_also":["continue","break","breakWith"]}