mIRC Homepage
Posted By: RoCk /var vs. /set -l - 14/06/07 02:31 PM
I also tested /var without the equals signs with same result.

Code:
alias testvar {
  var -s %var1 = test1
  var -s %var2 = test2
  var -s $+(%,var3.,%var2) = %var1
  echo -a $eval($+(%,var3.,%var2),2) <-- does not work
  echo -a ---
  set -ls %var1 test1
  set -ls %var2 test2
  set -ls $+(%,var3.,%var2) %var1
  echo -a $eval($+(%,var3.,%var2),2) <-- works
}


v6.21

~ Edit ~

Tested on all versions back to v5.91t with the same results.
Posted By: b1ink Re: /var vs. /set -l - 14/06/07 07:05 PM
That's weird. bug!!
Posted By: Wims Re: /var vs. /set -l - 14/06/07 09:25 PM
There are many thread about that, anyway, it's not a bug to me, /var always assume variable name begin with a %, if not, then the var is not set so :
var -s $+(%,var3.,%var2) = %var1 < this command won't be done smile
however, you can specify other variable witch will be set :

var -s $+(%,var3.,%var2) = %var1 ,%b 2
Posted By: RoCk Re: /var vs. /set -l - 14/06/07 09:50 PM
* RoCk *blinks*

huh?
Posted By: Wims Re: /var vs. /set -l - 14/06/07 10:42 PM
Ok, i know my english is poor but what is the point you didn't get ?

Posted By: Bekar Re: /var vs. /set -l - 14/06/07 11:21 PM
Wims, I think it's you who's not getting it.

The idea is to create a dynamic variable name, even if it's only within the local scope. It works fine using '/set', but not with '/var'.

RoCK, does the non-$+() form work?

Code:
var -s % $+ var3. $+ %var2 = %var1
_OR_
Code:
var -s % [ $+ var3. $+ %var2 ] = %var1

Posted By: Wims Re: /var vs. /set -l - 14/06/07 11:50 PM
Ah, sorry smile

I think /var -s $+(%,var3.,%var2) = %var1 works as it should but for both of your example, i don't know how mirc have to react
Posted By: Bekar Re: /var vs. /set -l - 15/06/07 12:09 AM
Originally Posted By: Wims
I think /var -s $+(%,var3.,%var2) = %var1 works as it should but for both of your example, i don't know how mirc have to react

It should create a local variable called '%var3.test2' with the value of 'test1'.
Posted By: RoCk Re: /var vs. /set -l - 15/06/07 12:20 AM
Originally Posted By: Wims
Ok, i know my english is poor but what is the point you didn't get?


Sorry Wims I left shortly after making my reply. Yes, pretty much what you said is the reason I started the thread. It should work and actually does work using /set -l.

Bekar

var -s %var3. [ $+ [ %var2 ] ] %var1

var -s % $+ var3. $+ %var2 %var1

Those methods work if the equals sign is not used. If the equals sign is used with either you get...

* Set %var3.test2 to = test1
-
= test1 <-- does not work

Anyway, using /set -l worked and I'm fine with using that if this can't or won't be fixed.
Posted By: Wims Re: /var vs. /set -l - 15/06/07 12:54 AM
Originally Posted By: RoCk
It should work and actually does work using /set -l.


No, i don't agreed :
//Var -s $+(%,a) 1
has never worked.
It's what you want ( i want too ), but not what mirc sould do.
Posted By: Bekar Re: /var vs. /set -l - 15/06/07 01:26 AM
Originally Posted By: Wims
//Var -s $+(%,a) 1
has never worked.

Thus why this is a 'bug'. It *SHOULD* work.
Posted By: Wims Re: /var vs. /set -l - 15/06/07 02:31 AM
Lol, like i said in my previous post, i don't think so.
i don't have any prooves to say that but : i think the fact is that mirc already doing something when variable name not begining with a '%', mirc not set the variable as You want or as the 'logical' want but ignore it.Maybe i'm wrong but i still think it's more a feature suggestion and i like it, than a 'bug'
© mIRC Discussion Forums