mIRC Home    About    Download    Register    News    Help

Print Thread
; after comparison operator in /if #109663 31/01/05 03:34 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline OP
Hoopy frood
OP Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
//if (ab isin ;ab) echo $v1 . $v2 .
//if (; isin ; ) echo $v1 . $v2 .


Seems easy enough, but mIRC 6.16 gives * /if: invalid format
If the ; is the first character after the comparison operator, the /if apparently always fails...

(Hope this hasn't been brought up before, searching for ";" seemed troublesome wink )

Re: ; after comparison operator in /if #109664 31/01/05 04:53 PM
Joined: Jan 2005
Posts: 20
C
C45P3R Offline
Ameglian cow
Offline
Ameglian cow
C
Joined: Jan 2005
Posts: 20
Just use $chr(59)

//if (ab isin $chr(59) $+ ab) echo $v1 . $v2 .
//if ($chr(59) isin $chr(59)) echo $v1 . $v2 .

Re: ; after comparison operator in /if #109665 31/01/05 06:30 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
He knows that,

the question is, why does it give an error, since ; doesn't have a special meaning in an if comparison, so its textual representation should suffice, without resorting to the ascii number.

It's particularly strange that it doesn't error when there's a space between the ; and the bracket ) but it does without the space.


Gone.
Re: ; after comparison operator in /if #109666 31/01/05 06:38 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
//if (; == wink echo -a fails
//if ( ; == wink echo -a fails
//if (1 == ;1) echo -a fails
//if (; == ; ) echo -a works
//if ( ; == ; ) echo -a works
//if (1 == 1;) echo -a does not give an error, but doesn't echo anything either, which is correct

The wink emoticon is supposed to be ; ) without a space.


New username: hixxy
Re: ; after comparison operator in /if #109667 31/01/05 06:43 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
(Hope this hasn't been brought up before, searching for ";" seemed troublesome wink )


maybe the search engine has the same If comparison error :-)

NO actually thanks for pointing it out, I had never seen this problem, so would have sat there some day going "Damn theres nothing wrong with this if statement wheres the error?".

Re: ; after comparison operator in /if #109668 01/02/05 06:11 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
According to the help on comments, a ; comment must BEGIN the line. IMHO this is a bug in the parser.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"