mIRC Homepage
Posted By: Venks How to use a wildcard pattern & a variable? - 03/07/17 10:58 PM
Code:
;Example 1
//while ($read(names.txt, nw, *Fred*, $calc($readn + 1))) echo -a $v1

;Example 2
var %dude = Fred
//while ($read(names.txt, nw, *%dude*, $calc($readn + 1))) echo -a $v1


Example 1 works without a problem. I'll pull the string that starts with Fred. But example 2 doesn't do anything. Is it possible to do a search with a variable?

I've been googling for ages and can't figure it out. I'm not exactly the best at this kind of stuff.
Code:
$+(*, %dude, *)
or: * $+ %dude $+ *

You can't touch the variable name with other text, and must use concatenation $+ to connect them.
Posted By: Wims Re: How to use a wildcard pattern & a variable? - 04/07/17 11:00 AM
Note also that using $read the way you are, to get all the lines matching, is quite slow, if you to get all the lines matching in a much faster way, check out /filter
© mIRC Discussion Forums