mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2006
Posts: 167
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Aug 2006
Posts: 167
Let's say I have these in [Variables]:

%myscript.crcA8310FFD text.txt
%myscript.crc1059EFAC photo.jpg
%myscript.crc011E8EA7 sound.wav
%myscript.crc4A9E01B9 source.cpp

Similar to how $findfile works, is there any mIRC scripting $function I can feed a wildcard mask to in order to find the names of all matching variables? I.e., using the example variables above, where $findvar(%myscript.crc*,0) would return 4 (the total), $findvar(%myscript.crc*,1) would return "%myscript.crcA8310FFD", and $findvar(%myscript.crc*,5) would return $null?

My problem is that I need to maintain a series of variables where what's on both sides of the "=" are variable. smile The only other solution I can think of is using just one variable with a predictable name, and populated thusly:

%myscript.crcs A8310FFD:text.txt 1059EFAC:photo.jpg 011E8EA7:sound.wav 4A9E01B9:source.cpp

And then making use of the token functions. But then I'm limited by mIRC's maximum variable length.

Joined: Jul 2006
Posts: 4,150
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,150
/help $var
$var(%myscript.crc*,0) = total number of variable that match.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2006
Posts: 167
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Aug 2006
Posts: 167
*pounds head on desk*

Thank you, mine savior. (And I feel doubly oblivious, as I've been sitting here working with $bvar the whole time on a separate portion of my script.)


Link Copied to Clipboard