ACE3/addons/common/functions/fnc_dumpArray.sqf

29 lines
611 B
Plaintext
Raw Normal View History

2015-03-10 19:59:40 +00:00
//fnc_dumpArray.sqf
#include "script_component.hpp"
2015-05-14 18:06:06 +00:00
private ["_pad", "_i", "_x"];
PARAMS_2(_var,_depth);
2015-03-10 19:59:40 +00:00
_pad = "";
2015-05-14 18:06:06 +00:00
2015-03-10 19:59:40 +00:00
for "_i" from 0 to _depth do {
_pad = _pad + toString [9];
2015-03-10 19:59:40 +00:00
};
2015-05-14 18:06:06 +00:00
2015-03-10 19:59:40 +00:00
_depth = _depth + 1;
2015-05-14 18:06:06 +00:00
if (IS_ARRAY(_var)) then {
if ((count _var) > 0) then {
diag_log text format["%1[", _pad];
{
[_x, _depth] call FUNC(dumpArray);
} forEach _var;
diag_log text format["%1],", _pad];
} else {
diag_log text format["%1[],", _pad];
};
2015-03-10 19:59:40 +00:00
} else {
diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
2015-03-10 19:59:40 +00:00
};