mIRC Home    About    Download    Register    News    Help

Print Thread
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.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Code:
$+(*, %dude, *)


I am SReject
My Stuff
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
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!
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard