2015-09-20 20:16:51 +00:00
|
|
|
/*
|
|
|
|
* Author: ?
|
|
|
|
* ?
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Array to be dumped <ARRAY>
|
|
|
|
* 1: Depth <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-03-10 19:59:40 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-20 20:16:51 +00:00
|
|
|
params ["_var", "_depth"];
|
2015-03-10 19:59:40 +00:00
|
|
|
|
2015-09-20 20:16:51 +00:00
|
|
|
private "_pad";
|
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 {
|
2015-04-06 16:22:43 +00:00
|
|
|
_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 {
|
2015-09-20 20:16:51 +00:00
|
|
|
if (count _var > 0) then {
|
2015-04-06 16:22:43 +00:00
|
|
|
diag_log text format["%1[", _pad];
|
2015-09-20 20:16:51 +00:00
|
|
|
|
2015-04-06 16:22:43 +00:00
|
|
|
{
|
|
|
|
[_x, _depth] call FUNC(dumpArray);
|
2015-09-20 20:16:51 +00:00
|
|
|
false
|
|
|
|
} count _var;
|
|
|
|
|
2015-04-06 16:22:43 +00:00
|
|
|
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
|
|
|
};
|