mIRC Home    About    Download    Register    News    Help

Print Thread
#138515 02/01/06 12:18 AM
Joined: Aug 2005
Posts: 128
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
It's something like a bug, between $var and /unset.

Test 1:
Code:
//var %i = 1 | var %hello01 = 1 | echo : $var(%hello*,%i)

$var works fine here

Let's use it in an /unset ...

Test 2:
Code:
//var %hello01 = 1 | echo 4 -a : %hello01 | unset -s $var(%hello*,1) | echo 4 -a : %hello01

Working fine too...
now let's use a variable name, instead of 1 at the $var

Test 3:
Code:
//var %hello01 = 1 | [color:red]var %i = 1[/color] | echo 4 -a : %hello01 | unset -s $var(%hello*,[color:red]%i[/color]) | echo 4 -a : %hello01

Looks like the variable is not unsetted anymore, even if in test 1, the $var returned fine... Pretty weird.

As a bugfix for it, you can use $($+(%,i),2) instead of %i.

Test 4:
Code:
//var %hello01 = 1 | [color:red]var %i = 1[/color] | echo 4 -a : %hello01 | unset -s $var(%hello*,[color:red]$($+(%,i),2)[/color]) | echo 4 -a : %hello01

Working fine now...

Edit:
If we make our own unset alias:
Code:
alias unset {
  echo 4 -a unsetting $1-
}

And then we use the Test 3, which failed.
We will see:
Quote:

unsetting -s 1

-s was the switch we specified, and 1 is the value of %i
Even more weird smile

Last edited by stefys99; 02/01/06 12:21 AM.
#138516 02/01/06 12:27 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
This has been reported before


Gone.
#138517 02/01/06 12:46 AM
Joined: Aug 2005
Posts: 128
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Whoops, didn't see it. Sorry.


Link Copied to Clipboard