mIRC Home    About    Download    Register    News    Help

Print Thread
How to make mIRC not skip $null tokens? #181993 03/08/07 04:21 AM
Joined: Feb 2005
Posts: 9
K
Kaepez Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: Feb 2005
Posts: 9
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.

Re: How to make mIRC not skip $null tokens? [Re: Kaepez] #181997 03/08/07 08:33 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com