Regex
is probably the best option, but just to show another method, you can also use $pos() combined with $mid().
alias stripdata {
var %pos.s = 0, %pos.e = $pos($1-,',1), %c = 1
while (%pos.e) {
var %data. $+ %c $mid($1-,%pos.s,$calc(%pos.e - %pos.s))
inc %c
var %pos.s = %pos.e, %pos.e = $pos($1-,',%c)
}
}
Note that this leaves the leading ' on each variable. This allows you to have null variables as they will have a ' in them. You can easily remove the ' when adding to your dialog. Variables would be %data.1 - %data.32 .
Again, regex is probably much better, but this is just to show another method for anyone learning mIRC scripting.
Edit: Testing this with the regex above gives 15-16 ms each (removing the /var %t line in the regex script and using $1- so there isn't an extra /var to take up time), so there doesn't appear to be any noticeable difference in speed between them.
