mIRC Home    About    Download    Register    News    Help

Print Thread
bug? #77109 29/03/04 08:35 AM
Joined: Dec 2002
Posts: 212
V
vasil_michev Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
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)


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
Re: bug? #77110 29/03/04 08:37 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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.


New username: hixxy
Re: bug? #77111 29/03/04 09:10 AM
Joined: Dec 2002
Posts: 212
V
vasil_michev Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
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


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
Re: bug? #77112 29/03/04 09:23 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
it doesn't return $null because it says a irc.server.com, $!!server returns irc.server.com according to your post anyway.


New username: hixxy
Re: bug? #77113 29/03/04 11:01 AM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: bug? #77114 29/03/04 11:50 AM
Joined: Dec 2002
Posts: 212
V
vasil_michev Offline OP
Fjord artisan
OP Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
starbucks_mafia thanks, I really needed a workaround


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
Re: bug? #77115 29/03/04 04:02 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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)".


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: bug? #77116 29/03/04 04:34 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Fair point. I guess this is just another disadvantage of unquoted strings.


Spelling mistakes, grammatical errors, and stupid comments are intentional.