mIRC Homepage
Posted By: atzplzw Set a local variable to another variable - 25/03/06 02:28 AM
Hi!

I want to set a local variable to another one: /var %a = %b
Sadly that doesn't work.
I want the variable to be local so is there any solution?

Actually what I'm trying to do is to join to strings into a new var:
/var %string = $+(%word1, %word2)

So maybe you got a solution...

Thanks!
Quote:

Actually what I'm trying to do is to join to strings into a new var:
/var %string = $+(%word1, %word2)

what you are doing is setting %straing to eaqual %word1%word2
thar variable doesnt exist, so it fails


try it like this
var %string = %word1 %word2


Posted By: atzplzw Re: Set a local variable to another variable - 25/03/06 11:48 AM
Same problem, doesn't work.

%string is always $null except if I add some real char in between:

/var %string = 1 %word1 2 %word2
echo -a %string -> 1 2
Posted By: jaytea Re: Set a local variable to another variable - 25/03/06 02:41 PM
Code:
//var -s %word1 = a, %word2 = b, %string = %word1 $+ %word2


works.. in fact everything you mentioned sounds fine. you sure %word1 and %word2 contain values?
Posted By: atzplzw Re: Set a local variable to another variable - 25/03/06 09:23 PM
Thanks guys for all your help!

I figured out that I did not call the alias I was using correctly.
I did: /GenDir(%word1 %word2)

alias GenDir {
/var %word1 = $1
/var %word2 = $2

...
}

So the correct syntax would be /GenDir(%word1, %word2)

Now it works fine.
Thanks for help!
© mIRC Discussion Forums