{"name":"scopeName","title":"scopeName","type":"command","url":"https://community.bistudio.com/wiki/scopeName","revid":363355,"updated":"2024-03-27T12:05:28Z","groups":["Program Flow"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Defines name of current scope. Name is visible in debugger, and name is also used as reference in some commands like breakOut and breakTo.\nScope name should be defined only once per scope. Trying to set a different name on the scope that has already defined scope name will result in error.","syntaxes":[{"syntax":"scopeName name","params":[{"name":"name","type":"String","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"name"}}],"examples":[{"text":"```sqf\nscopeName \"main\";\nwhile { sleep 0.1; true } do\n{\n    scopeName \"loop1\";\n\n    while { sleep 0.1; true } do\n    {\n        scopeName \"loop2\";\n\n        // ...\n    };\n};\n```","code":["scopeName \"main\";\nwhile { sleep 0.1; true } do\n{\n\tscopeName \"loop1\";\n\n\twhile { sleep 0.1; true } do\n\t{\n\t\tscopeName \"loop2\";\n\n\t\t// ...\n\t};\n};"]},{"text":"```sqf\nif (true) then\n{\n    scopeName \"mainScope\";\n    scopeName \"main_scope\"; // error\n};\n```","code":["if (true) then\n{\n\tscopeName \"mainScope\";\n\tscopeName \"main_scope\"; // error\n};"]}],"see_also":["breakOut","breakTo"]}