mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 2,125
Q
qwerty Offline OP
Hoopy frood
OP Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
Many token idents support negative indexes, but not all. For example, $gettok(a b c d e,-1,32) returns "e", but $findtok(A b c A d e A,A,-1,32) does not return "7" (as $findtok(A b c A d e A,A,3,32) does). $findtok, $matchtok, $wildtok, $reptok and $remtok should accept a negative N and act on the <total+1+N>th token, just like $gettok. Imo, the ability to use negative indexes should be extended to almost every mirc identifier that accepts a N (for example $line()), but you can get away with adding it to just these token idents, for now :tongue:

And while you're at it, make $remtok/$reptok accept 0 as N and remove/replace ALL instances of the token in the input. I think this would be extremely useful, perhaps even more than the previous suggestion.

Joined: Mar 2003
Posts: 1,256
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,256
don't $remove and $replace do that already ?

Joined: Dec 2002
Posts: 1,253
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,253
$remove(This moo is a moo-moo farm where cows go moo at the moon., moo)
-> This is a - farm where cows go at the n.

$remtok(This moo is a moo-moo farm where cows go moo at the moon., moo, 0, 32)
-> This is a moo-moo farm where cows go at the moon.


Link Copied to Clipboard