mIRC Home    About    Download    Register    News    Help

Print Thread
#77109 29/03/04 08:35 AM
Joined: Dec 2002
Posts: 209
V
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 209
can anyone explain what is this? How come
//.timer 1 1 scon -a if (($$!!server)) echo -a a $!!server
or
//.timer 1 1 scon -a $iif($!!server,echo -a a $!!server)
produces this output:
a
a irc.interbgc.com
a irc.zonebg.com

I have opened 3 server connections, the first one can't be established though. How can $!!server return something in the if comparison, and later return $null?
(Sorry for spamming the servers)

#77110 29/03/04 08:37 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
it returns $null because mirc doesn't know what the server is, but because you make it echo "a <server>" it will still output a, but not $null, so what you are seeing isn't a bug.

#77111 29/03/04 09:10 AM
Joined: Dec 2002
Posts: 209
V
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 209
I'm pretty much aware of that, but as you can probably see there's a BIG if ($!!server) out there, which is NOT supposed to work when $!!server returns $null

#77112 29/03/04 09:23 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
it doesn't return $null because it says a irc.server.com, $!!server returns irc.server.com according to your post anyway.

#77113 29/03/04 11:01 AM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
It's a result of some strange parsing based on whether anything is touching the identifiers.

For instance:
//.timer 1 1 scon -a if ( $!!server ) echo -a a $!!server (notice the spaces between the parentheses) will work
//.timer 1 1 scon -a if ($server) echo -a a $!!server (no spaces but no !'s either) will work
//.timer 1 1 scon -a $!!iif( $!!server,echo -a a $!!ifmatch : $!!server) will work
//.timer 1 1 scon -a $!!iif($server,echo -a a $!!ifmatch : $!!server) will work

Basically the important thing is to either put a space between the starting $ of an identifier and then use !!, or otherwise put something like a parenthesis against it and then use no !!'s.

I think this probably should be considered a bug, or at least a part of the parser which would be a hell of a lot better if it was altered.

#77114 29/03/04 11:50 AM
Joined: Dec 2002
Posts: 209
V
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 209
starbucks_mafia thanks, I really needed a workaround

#77115 29/03/04 04:02 PM
Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
Imo it's not a bug. As far as /timer or /scon is concerned, a string of the form (something) is just plain text. /timer and /scon don't (and perhaps shouldn't) know that (something) is meant to be an if statement. Unless you consider a bug the fact that //echo -a ($me) echoes "($me)".

#77116 29/03/04 04:34 PM
Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
Fair point. I guess this is just another disadvantage of unquoted strings.


Link Copied to Clipboard