mIRC Home    About    Download    Register    News    Help

Print Thread
How to use a wildcard pattern & a variable? #260913 03/07/17 10:58 PM
Joined: Jan 2016
Posts: 3
V
Venks Offline OP
Self-satisified door
OP Offline
Self-satisified door
V
Joined: Jan 2016
Posts: 3
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.

Re: How to use a wildcard pattern & a variable? [Re: Venks] #260915 03/07/17 11:32 PM
Joined: Apr 2010
Posts: 943
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 943
Code:
$+(*, %dude, *)


I am SReject
My Stuff
Re: How to use a wildcard pattern & a variable? [Re: FroggieDaFrog] #260916 04/07/17 06:02 AM
Joined: Feb 2003
Posts: 2,692
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,692
or: * $+ %dude $+ *

You can't touch the variable name with other text, and must use concatenation $+ to connect them.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: How to use a wildcard pattern & a variable? [Re: Venks] #260920 04/07/17 11:00 AM
Joined: Jul 2006
Posts: 3,702
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,702
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


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net