mIRC Home    About    Download    Register    News    Help

Print Thread
Variable using a variable #200717 10/06/08 01:16 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Hi there,
How do you message a variable by using another variable...

Code:
%test_1 = test
%1 = 1
msg $chan %test_ $+ %1


Doesn't message %test_1

Re: Variable using a variable [Re: Ninko] #200718 10/06/08 02:15 PM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
It's because mirc first evaluate %test_ ($null) then %1, and after stick them.Use $($+(%,test_,%1),2) for exemple

Last edited by Wims; 10/06/08 02:16 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Variable using a variable [Re: Wims] #200719 10/06/08 03:05 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Thanks for the reply Wims. Can you explain what the code is doing there please, I'm learning lol. Also is that really the only way of doing it?

Thanks


Ninko

Re: Variable using a variable [Re: Ninko] #200727 10/06/08 05:40 PM
Joined: Jul 2006
Posts: 3,530
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,530
$+() stick the data, $+(a,b,c) will return abc.
Here, $+(%,test_,%1) will return %test_1 because each parameter are evaluate but since you don't want %test_1 but the value of it, you need to evaluate the whole thing another time, $(,2) (the same as $eval(,2)) do it.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Variable using a variable [Re: Wims] #200821 12/06/08 09:13 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Thank you Wims!

Take care


Ninko