mIRC Home    About    Download    Register    News    Help

Print Thread
#89954 10/07/04 07:23 PM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
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


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
#89955 10/07/04 07:29 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
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,


Mentality/Chris
#89956 10/07/04 08:09 PM
Joined: Sep 2003
Posts: 149
S
Stealth Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Sep 2003
Posts: 149
If this will help at all, here is the code that it is supposed to work in:

Code:
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
  }
}  


mIRC 6.21 - Win XP Pro (SP2) - 2.4 Ghz - 1 GB Mem
irc.x-tab.org
#89957 10/07/04 08:12 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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.

#89958 10/07/04 11:06 PM
Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
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.


Sais
#89959 12/07/04 05:28 AM
Joined: Mar 2004
Posts: 36
N
Ameglian cow
Offline
Ameglian cow
N
Joined: Mar 2004
Posts: 36
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.

#89960 17/07/04 08:30 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Another alternative (less confusing IMHO) is to just use 'unset %var $+ $(%var2)'.


* cold edits his posts 24/7

Link Copied to Clipboard