mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 1
B
Buuyo Offline OP
Mostly harmless
OP Offline
Mostly harmless
B
Joined: Aug 2004
Posts: 1
Hi. How would I escape a comma character for use in a function like $var()? Like, say I wanted to match variables like this: %onjoin,* $var(%onjoin,*) would be using * as a the second argument, not as a part of the first argument. I'd like the first argument to be %onjoin,*.

Thanks.

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
Try:
$var( $+(%onjoin,$chr(44),*) )

$chr(44) is the comma


Maybe I wake up one day to notice that all my life was just a dream!
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
I do not believe that will work (it didn't for me in testing). The %onjoin is being evaluated when it shouldn't be, the fix is simple: $var( $+(%,onjoin,$chr(44),*) )

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
You are right... Sorry I missed that...
I was focusing on the $chr(44) thing...

Last edited by dr_Eamer; 28/08/04 09:30 PM.

Maybe I wake up one day to notice that all my life was just a dream!
Joined: Sep 2004
Posts: 3
Z
Self-satisified door
Offline
Self-satisified door
Z
Joined: Sep 2004
Posts: 3
use brackets to append characters to your %variable.... though, it will still be run thru $var as a thing with a comma in it, which wont work.

agreed: mIRC needs escape characters.

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
I don't quite follow you I'm afraid...
Appending characters to a variable name does need the evaluation brackets:
set %onjoin, [ $+ [ $whatever ] ] 2004

The $var statement described above works perfectly!

I didn't get what "wont work"... Sorry.
It is late here now so pardon me if I don't see something obvious...


Maybe I wake up one day to notice that all my life was just a dream!
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well JFI, you need them or $eval() to evaluate (read) the var, but not to set such a var.
//set %onjoin, $+ $whatever 2004
^ Works fine smile

Joined: Aug 2004
Posts: 101
D
Vogon poet
Offline
Vogon poet
D
Joined: Aug 2004
Posts: 101
You're so right...
blush smile


Maybe I wake up one day to notice that all my life was just a dream!

Link Copied to Clipboard