mIRC Homepage
Posted By: Kaepez How to make mIRC not skip $null tokens? - 03/08/07 04:21 AM
I could explain using words, but an example would do much better:

For instance:

$gettok(a||b ,1 ,124) returns a
$gettok(a||b ,2 ,124) returns b

But I'd like
$gettok(a||b ,2 ,124) to return $null
and
$gettok(a||b ,3 ,124) to return b

I can't think of any particular workaround besides using a lot of $mid()s, and I was wondering if there was an easier way to do it that I overlooked.

Thanks in advance.
Posted By: qwerty Re: How to make mIRC not skip $null tokens? - 03/08/07 08:33 AM
Code:
alias gettokn {
  var %c = \x $+ $base($3,10,16,2)
  returnex $remove($gettok($regsubex($1,/(?<=^| %c )(?=$| %c )/gx,$lf),$2,$3),$lf)
}
Then use $gettokn() in place of $gettok() in your script (the syntax is exactly the same).
© mIRC Discussion Forums