mIRC Home    About    Download    Register    News    Help

Print Thread
#89567 08/07/04 05:58 AM
Joined: Jul 2004
Posts: 1
A
addy Offline OP
Mostly harmless
OP Offline
Mostly harmless
A
Joined: Jul 2004
Posts: 1
Hello there
a friend and me have found a bug with the identifier $iif.
When you put a "&" in a comparison, the whole thing doesn't go correctly.
Like:

Quote:
(23:13:09) <addy> $iif(3 & 3 == ... & ...,yes,no) == yes

#89568 08/07/04 07:22 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
When you pass a literal & as a word to if or $iif(), it's sometimes hard for the parser to decide if it's a normal parameter or the bitwise comparison operator.

To avoid the ambiguity you can first assign the text to a variable...
  • //var %v1 = 3 & 3, %v2 = ... & ... | echo -a $iif(%v1 == %v2,yes,no)
...or place it inside a $() -
  • //echo -a $iif([color:blue]$(3 & 3) == $(... & ...),yes,no)[/color]


Link Copied to Clipboard