TMWA does not support undefined array elements
Created by: Helianthella
Right now if you do setarray $@foo, 5, 6, 0, 0;
the server will tell you that your array size is 2. This is because getarraysize()
checks for the last non-0 element of the array and returns its index. TMWA should set undefined array elements to the NUL
character (\0
) internally so that it knows the difference between undefined and 0. Once it's done, We could also add a unset
or reset
builtin to change back an array element to NUL
, thus making it undefined again. The best solution would be to allow to use NUL
directly in scripts but that might confuse people so using builtins like isdefined
or isnull
to check if an array element is defined would likely be better.