{"name":"diag_scope","operator":null,"title":"diag scope","type":"command","url":"https://community.bistudio.com/wiki/diag_scope","revid":369074,"updated":"2024-09-02T20:25:00Z","groups":["Diagnostic","Performance Profiling"],"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":"Returns script scope depth. When script is directly executed by the engine or a new script is added to the scheduler, the scope depth is 0.\nThe examples of such execution are event handlers, spawn, etc. isNil Code will also create a parent scope.\nAny use of call and such will stack execution creating child scopes and increasing scope depth.","syntaxes":[{"syntax":"diag_scope","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Number","types":["Number"],"description":null,"text":"Number"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\n0 spawn\n{ \n    systemChat str diag_scope; // 0\n    call \n    { \n        call\n        { \n            systemChat str diag_scope; // 2\n            isNil \n            { \n                systemChat str diag_scope; // 0\n                call \n                {\n                    systemChat str diag_scope; // 1\n                };\n            };\n        };\n    };\n};\n```","code":["0 spawn\n{ \n\tsystemChat str diag_scope; // 0\n\tcall \n\t{ \n\t\tcall\n\t\t{ \n\t\t\tsystemChat str diag_scope; // 2\n\t\t\tisNil \n\t\t\t{ \n\t\t\t\tsystemChat str diag_scope; // 0\n\t\t\t\tcall \n\t\t\t\t{\n\t\t\t\t\tsystemChat str diag_scope; // 1\n\t\t\t\t};\n\t\t\t};\n\t\t};\n\t};\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["exitWith","diag_fps","diag_fpsMin","diag_frameNo","diag_log","diag_tickTime","diag_deltaTime"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Diagnostic","Command Group: Performance Profiling","Introduced with Arma 3 version 2.02","Scripting Commands"]}