mIRC Homepage
Posted By: Ninko Variable using a variable - 10/06/08 01:16 PM
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
Posted By: Wims Re: Variable using a variable - 10/06/08 02:15 PM
It's because mirc first evaluate %test_ ($null) then %1, and after stick them.Use $($+(%,test_,%1),2) for exemple
Posted By: Ninko Re: Variable using a variable - 10/06/08 03:05 PM
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
Posted By: Wims Re: Variable using a variable - 10/06/08 05:40 PM
$+() 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.
Posted By: Ninko Re: Variable using a variable - 12/06/08 09:13 PM
Thank you Wims!

Take care


Ninko
© mIRC Discussion Forums