mIRC Home    About    Download    Register    News    Help

Print Thread
//if #77352 31/03/04 12:07 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
//if (x isin x, say yes!)
type this from the command line and this will say: yes! (even though it's in the wrong format for an /if statement)
but yesterday, i typed this (or something very similar to this and it gave: * /if: ambiguous format.


New username: hixxy
Re: //if #77353 31/03/04 12:12 PM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
Code:
//if ((x isin x,)  { echo -a yes! )


-> yes!

(no complaint about a missing '}', no terminal ')' printed ....)

Last edited by Sais; 31/03/04 12:19 PM.

Sais
Re: //if #77354 31/03/04 12:36 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
It is a valid (if highly unreadable) format, it's not being parsed as two parameters like you think though:
//if (x isin x, say yes!)
The default condition mIRC will look for is operator operand operator, from your example that works out as x isin x,
The commands are taken to be whatever comes next, that is say yes!.
The parentheses are superfluous, just working as grouping, but it'll work just the same without them.

Seeing as it's an incredibly bad format to use, it's no surprise that something similar to this would be treated as ambiguous format, why not use a more readable and structured format instead?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: //if #77355 31/03/04 01:16 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
i use: if statement { stuff }
but i typed //if instead of //say $iif by accident, one day it said the ambiguous format, the next it didn't.


New username: hixxy
Re: //if #77356 31/03/04 01:19 PM
Joined: Oct 2003
Posts: 313
S
Sais Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
I think the unexpected thing is that it *is* being parsed as two parameters, not as one (the one surrounded by parentheses). I would expect it to give an error such as "if: invalid format" - i.e. it's missing a command. Parentheses do not define a grouping anywhere but in a conditional....

I mean - I see that as
Code:
 
//if ([color:red]x[/color] [color:blue]isin[/color] [color:red]x, say yes![/color])


operand operator operand

...but maybe I'm just expecting it to be like certain other languages ;P


Sais