alias freenullvars {
;== Find how many vars exist and set a count variable.
var %x = $var(*,0) + 1
;== We increase x by 1 because at the time of calling $var, x is not set yet....
echo -a *** Testing %x variables...
;== Loop thru all variables backwards so freeing a null variable doesn't affect the rests $var() index
while (%x && $var(*,%x)) {
;== Determine if it's not local, isn't on a decay timer, and is null, if so erase.
if (!$var(*,%x).local && !$var(*,%x).secs && !$var(*,%x).value) {
echo -a *** Removing null variable: $var(*,%x)
unset [ $var(*,%x) ]
}
else { echo -a *** Keeping $var(*,%x) . Local? $var(*,%x).local Decay? $var(*,%x).secs Null? $iif(!$var(*,%x).value,$true,$false) }
;== Decrease count variable
dec %x
}
}