mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline OP
Hoopy frood
OP Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
don't $remove and $replace do that already ?


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$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.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard