mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2004
Posts: 3
A
atzplzw Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Mar 2004
Posts: 3
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!

Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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



Joined: Mar 2004
Posts: 3
A
atzplzw Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Mar 2004
Posts: 3
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

Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
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?


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Mar 2004
Posts: 3
A
atzplzw Offline OP
Self-satisified door
OP Offline
Self-satisified door
A
Joined: Mar 2004
Posts: 3
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!


Link Copied to Clipboard