diag scope: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|seealso= *\[\[([^ ]+)\]\], \[\[([^ ]+)\]\]" to "|seealso= $1 $2")
m (Some wiki formatting)
 
Line 8: Line 8:
|gr2= Performance Profiling
|gr2= Performance Profiling


|descr= 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. The examples of such execution are event handlers, [[spawn]], etc. [[isNil]] [[Code]] will also create a parent scope. Any use of [[call]] and such will stack execution creating child scopes and increasing scope depth.
|descr= 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.
The examples of such execution are event handlers, [[spawn]], etc. [[isNil]] [[Code]] will also create a parent scope.
Any use of [[call]] and such will stack execution creating child scopes and increasing scope depth.


|s1= [[diag_scope]]
|s1= [[diag_scope]]
Line 14: Line 16:
|r1= [[Number]]
|r1= [[Number]]


|x1= <code>[] [[spawn]]
|x1= <sqf>
[] spawn
{  
{  
[[systemChat]] [[str]] [[diag_scope]]; // 0
systemChat str diag_scope; // 0
[[call]]
call  
{  
{  
[[call]]
call
{  
{  
[[systemChat]] [[str]] [[diag_scope]]; // 2
systemChat str diag_scope; // 2
[[isNil]]
isNil  
{  
{  
[[systemChat]] [[str]] [[diag_scope]]; // 0
systemChat str diag_scope; // 0
[[call]]
call  
{
{
[[systemChat]] [[str]] [[diag_scope]]; // 1
systemChat str diag_scope; // 1
};
};
};
};
};
};
};
};
};</code>
};
</sqf>


|seealso= [[exitWith]] [[diag_fps]] [[diag_fpsMin]] [[diag_frameNo]] [[diag_log]] [[diag_tickTime]] [[diag_deltaTime]]
|seealso= [[exitWith]] [[diag_fps]] [[diag_fpsMin]] [[diag_frameNo]] [[diag_log]] [[diag_tickTime]] [[diag_deltaTime]]
}}
}}

Latest revision as of 14:44, 5 May 2022

Hover & click on the images for description

Description

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. The examples of such execution are event handlers, spawn, etc. isNil Code will also create a parent scope. Any use of call and such will stack execution creating child scopes and increasing scope depth.
Groups:
DiagnosticPerformance Profiling

Syntax

Syntax:
diag_scope
Return Value:
Number

Examples

Example 1:
[] spawn { systemChat str diag_scope; // 0 call { call { systemChat str diag_scope; // 2 isNil { systemChat str diag_scope; // 0 call { systemChat str diag_scope; // 1 }; }; }; }; };

Additional Information

See also:
exitWith diag_fps diag_fpsMin diag_frameNo diag_log diag_tickTime diag_deltaTime

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note