diag stacktrace: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{RV|type=command |game1= arma3 |version1= 2.06 |branch= dev |descr= Returns an array containing the function name, line number, scope name and all local variables in form...")
 
m (Some wiki formatting)
Line 10: Line 10:
|gr1= Diagnostic
|gr1= Diagnostic


|s1= [[{{PAGENAMEE}}]]
|s1= [[diag_stacktrace]]


|r1= [[Array]] - in format
|r1= [[Array]] in format:
* 0: [[String]] - function name
<syntaxhighlight lang="cpp">params ["_functionName", "_lineNumber", "_scopeName", "_variablesHashmap"];</syntaxhighlight>
* 1: [[Number]] - line number
* _functionName: [[String]] - function name
* 2: [[String]] - scope name
* _lineNumber: [[Number]] - line number
* 3: [[HashMap]] - all local variables
* _scopeName: [[String]] - scope name
* _variablesHashmap: [[HashMap]] - all local variables


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


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

Revision as of 09:28, 20 September 2021

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.06.

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