mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 2,812
Raccoon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
//var %foo = bar | echo -a $+(test,123,(,%foo,),xyzzy,(,plugh,))
> test123(,%foo,)xyzzy(,plugh,)

Same deal with $eval() aka $().

Seems that parenthesis within these identifiers (and possibly others) creates a nesting protection between parameters.

Kind of like the nesting peren protection we enjoy when using commas and curly brackets {} within a regular expression pattern.

Just wasn't expecting this. Maybe it's useful? Has it been like this a very long time?


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 5,412
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,412
Thanks for your bug report. This is by design. The () brackets are used to contain the parameters of the identifier. These are how the parser determines the beginning and ending of a bracketed identifier. If you need to use these inside an identifier, you should assign the parameter to a variable first.

Joined: Aug 2003
Posts: 319
P
Pan-dimensional mouse
Offline
Pan-dimensional mouse
P
Joined: Aug 2003
Posts: 319
Alternatively use $chr(40) for "(" and $chr(41) for ")" i.e.
Code
//var %foo = bar | echo -a $+(test,123,$chr(40),%foo,$chr(41),xyzzy,$chr(40),plugh,$chr(41))
> test123(bar)xyzzy(plugh)


Or to make it even more readable use an alias identifier $lbr for $chr(40) and $rbr for $chr(41).


Link Copied to Clipboard