Unset doesnt seem to work in this way...
unset % $+ %blah
I need to have it like this to work:
unset $eval(% $+ %blah,1)
This was found in mIRC 6.15, I don't know if it is the same in 6.16
It works fine here, I tested from the command line and in an ON INPUT event...if you're doing it from the command line make sure you use both //. I tested this on 6.16.
As an FYI I don't believe you need to specify the ,1 in the $eval as it defaults to 1 if N is not supplied.
Regards,
If this will help at all, here is the code that it is supposed to work in:
alias err_timeout {
if ($left($1,5) == query) {
set %errnick $gettok($1,2-,$asc(_))
if ($dialog($1)) { dialog -c $1 }
tokenize 32 $eval($+(%,$1),2)
.msg %errnick 14Your PM request has timed out. Please try again later.
window -k0 @page
aline -p @page $kts $server [PM] < $+ %errnick $+ > $2-
write $logdir $+ page.log $kts $server [PM] < $+ %errnick $+ > $2-
echo -s 4Query from %errnick timed out.
.ignore -r %errnick
unset %query_ $+ %errnick
}
}
You can call this a bug, however qwerty noted that this could be a side-effect of the multi-variable-unset feature of /unset (/unset %a %b %c), which prevents evaluation of all %variable parameters.
The script as stands would seem to attempt to unset %query_ $+ %errnick... i.e. the concatenation of the value of the variable %query_ and that of %errnick (assuming it attempts to evaluate the $+ at all), however, even using $+(%,query_,%errnick) (which I would assume would evaluate before the unset was performed) didn't work until I wrapped it in an eval:
//unset $($+(%,query_,%errnick))
What I also note is that using unset -s with any of the invalid cases does not show anything; perhaps an error message would be useful.
ive found that setting and unsetting variables will respond better if you use [ brackets
such as %var [ $+ [ %var2 ] ]
that should resolve any issues with unset not working.
Another alternative (less confusing IMHO) is to just use 'unset %var $+ $(%var2)'.