mIRC Home    About    Download    Register    News    Help

Print Thread
#138345 29/12/05 03:52 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
From 02/04/97 - mIRC v5.0

Quote:
73.Can now use & character as a wildcard one word match, eg.

& lines would &
These lines would match


//if (& & iswm ab cd) echo match

--> doesn't match

//if (& iswm cd) echo match

--> does match

//if (& iswm &cd) echo match

--> doesn't match (no it doesn't confuse the &cd for a binvar because //if (& isin &cd) echo -a, works fine)

//if (& iswm cd&) echo match

--> does match

My point is, there seems to be some inconsistency in the way & matches, and it would be nice to see the behaviour of & fixed.


Gone.
#138346 29/12/05 11:30 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
This isn't a bug: & is an operator, and mIRC simply uses the first operator that it finds in conditions. Putting the wildcard text in a variable will overcome the problem.


Saturn, QuakeNet staff
#138347 29/12/05 12:41 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
This report is not about the & bitwise operator it is about the & wildcard that matches a standalone word, which you could have known because I explicitly quoted the line that says:

Quote:

73.Can now use & character as a wildcard one word match, eg.

& lines would &
These lines would match


There's no reason for: //if (& iswm &cd) echo match

not to work, as it is a completely unambiguous iswm statement.


Gone.
#138348 29/12/05 12:45 PM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Ah, I thought the second part of your examples was merely a further illustration of the first problem, sorry. Yes, it seems like that is a bug, and a rather strange one at that! The same failure to match happens in "on TEXT" triggers, so this is not an /if-related problem either..


Saturn, QuakeNet staff
#138349 04/01/06 07:17 PM
Joined: Dec 2002
Posts: 87
Babel fish
Offline
Babel fish
Joined: Dec 2002
Posts: 87
(empty)

#138350 04/01/06 07:57 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
OP Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
& is a wildcard that matches a "word", it is very different from * which matches anything (character, word, sentence)

Your own examples don't even hold water:

//if (& iswm cd&) echo true

That echoe's true, however by your rationale that should not echo anything because you would need to use:

//if (*& iswm cd&) echo true



Because this is the normal case, check this:

//if (a iswm bla) echo match
--> no match

//if (*a iswm bla) echo match
--> match

& matches a word, get it?

//if (& iswm thisisalongword) echo match
--> match


The bug lies in the fact that:

//if (& iswm &bla) echo match

doesn't echo match, whilst there is no reason for it not to, because just like in the example before this, I'm simply trying to match one word, very different from:

//if (&* iswm &bla bla bla bla) echo match
--> match, which matches not just a word, but a whole sentence

Next time educate yourself first on the matter before trying to school me.


Gone.

Link Copied to Clipboard