mIRC Home    About    Download    Register    News    Help

Print Thread
#178779 14/06/07 02:31 PM
Joined: Dec 2002
Posts: 2,031
R
RoCk Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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.

RoCk #178792 14/06/07 07:05 PM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
That's weird. bug!!


Kind Regards, blink
RoCk #178801 14/06/07 09:25 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #178802 14/06/07 09:50 PM
Joined: Dec 2002
Posts: 2,031
R
RoCk Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
* RoCk *blinks*

huh?

RoCk #178803 14/06/07 10:42 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Ok, i know my english is poor but what is the point you didn't get ?



#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #178806 14/06/07 11:21 PM
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
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


Bekar #178807 14/06/07 11:50 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #178808 15/06/07 12:09 AM
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
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'.

Wims #178809 15/06/07 12:20 AM
Joined: Dec 2002
Posts: 2,031
R
RoCk Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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.

RoCk #178812 15/06/07 12:54 AM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #178813 15/06/07 01:26 AM
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Originally Posted By: Wims
//Var -s $+(%,a) 1
has never worked.

Thus why this is a 'bug'. It *SHOULD* work.

Bekar #178817 15/06/07 02:31 AM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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'


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard