2015-03-10 19:59:40 +00:00
|
|
|
//fnc_dumpArray.sqf
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_var", "_depth", "_pad", "_i", "_x"];
|
|
|
|
|
|
|
|
_var = _this select 0;
|
|
|
|
_depth = _this select 1;
|
|
|
|
_pad = "";
|
|
|
|
for "_i" from 0 to _depth do {
|
2015-04-06 16:22:43 +00:00
|
|
|
_pad = _pad + toString [9];
|
2015-03-10 19:59:40 +00:00
|
|
|
};
|
|
|
|
_depth = _depth + 1;
|
|
|
|
if(IS_ARRAY(_var)) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
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 {
|
2015-04-06 16:22:43 +00:00
|
|
|
diag_log text format["%1%2", _pad, [_var] call FUNC(formatVar)];
|
2015-03-10 19:59:40 +00:00
|
|
|
};
|