mIRC Homepage
Posted By: tidy_trax //if - 31/03/04 12:07 PM
//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.
Posted By: Sais Re: //if - 31/03/04 12:12 PM
Code:
//if ((x isin x,)  { echo -a yes! )


-> yes!

(no complaint about a missing '}', no terminal ')' printed ....)
Posted By: starbucks_mafia Re: //if - 31/03/04 12:36 PM
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?
Posted By: tidy_trax Re: //if - 31/03/04 01:16 PM
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.
Posted By: Sais Re: //if - 31/03/04 01:19 PM
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
© mIRC Discussion Forums