diag stacktrace: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Some wiki formatting)
(One intermediate revision by the same user not shown)
Line 3: Line 3:
|game1= arma3
|game1= arma3
|version1= 2.06
|version1= 2.06
|branch= dev


|descr= Returns an array containing the function name, line number, scope name and all local variables in form of a hashmap.
|descr= Returns an array containing the function name, line number, scope name and all local variables in form of a hashmap.
Line 13: Line 11:


|r1= [[Array]] in format:
|r1= [[Array]] in format:
<syntaxhighlight lang="cpp">params ["_functionName", "_lineNumber", "_scopeName", "_variablesHashmap"];</syntaxhighlight>
<sqf>params ["_functionName", "_lineNumber", "_scopeName", "_variablesHashmap"];</sqf>
* _functionName: [[String]] - function name
* _functionName: [[String]] - function name
* _lineNumber: [[Number]] - line number
* _lineNumber: [[Number]] - line number
Line 19: Line 17:
* _variablesHashmap: [[HashMap]] - all local variables
* _variablesHashmap: [[HashMap]] - all local variables


|x1= <code>[[private]] _testvar = 1;
|x1= <sqf>
[[private]] _testother = 2;
private _testvar = 1;
[[call]]
private _testother = 2;
call  
{
{
_testvar = 3;
_testvar = 3;
[[if]] (_testvar == 3) [[then]]
if (_testvar == 3) then  
{
{
_myVariable = 4;
_myVariable = 4;
[[hint]] [[str]] [[diag_stacktrace]];
hint str diag_stacktrace;
};
};
};
};
{{codecomment|/*
/*
[
[
["", 3, "", [["_this", []], ["_testother", 2], ["_testvar", 3]]],
["", 3, "", [["_this", []], ["_testother", 2], ["_testvar", 3]]],
["", 6, "", []],
["", 6, "", []],
["", 8, "", [<nowiki/>["_myvariable", 4]]]
["", 8, "", [["_myvariable", 4]]]
]
]
<nowiki/>*/}}</code>
*/
</sqf>


|seealso= [[diag_dumpCalltraceToLog]]
|seealso= [[diag_dumpCalltraceToLog]]
}}
}}

Revision as of 18:54, 5 May 2022

Hover & click on the images for description

Description

Description:
Returns an array containing the function name, line number, scope name and all local variables in form of a hashmap.
Groups:
Diagnostic

Syntax

Syntax:
diag_stacktrace
Return Value:
Array in format:
params ["_functionName", "_lineNumber", "_scopeName", "_variablesHashmap"];
  • _functionName: String - function name
  • _lineNumber: Number - line number
  • _scopeName: String - scope name
  • _variablesHashmap: HashMap - all local variables

Examples

Example 1:
private _testvar = 1; private _testother = 2; call { _testvar = 3; if (_testvar == 3) then { _myVariable = 4; hint str diag_stacktrace; }; }; /* [ ["", 3, "", [["_this", []], ["_testother", 2], ["_testvar", 3]]], ["", 6, "", []], ["", 8, "", "_myvariable", 4] ] */

Additional Information

See also:
diag_dumpCalltraceToLog

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