mIRC Home    About    Download    Register    News    Help

Print Thread
$count #153896 24/07/06 08:39 AM
Joined: Jun 2004
Posts: 25
Q
Quia Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jun 2004
Posts: 25
I am trying to write a script that will count the number of occurances of a long list of words, and it doesn't seem to be possible to do it the way I was thinking of..

$count($1-,%terms), with %terms being a list like so %term1,term2,term3,..termN. However, $count insists on considering this one whole term, and will only match the whole list at once, not the individual terms.

Is it possible to do something like this?

Re: $count #153897 24/07/06 08:52 AM
Joined: Feb 2004
Posts: 206
D
Darwin_Koala Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Feb 2004
Posts: 206
help $numtok and other token related commands

Quote:
$numtok(text,C)

Returns number of tokens in text.


e.g. $numtok($1-,44) or $numtok(%terms, 44) (I think 44 is ",")

Cheers,

DK


Darwin_Koala

Junior Brat, In-no-cent(r)(tm) and original source of DK-itis!
Re: $count #153898 24/07/06 10:07 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Try $count($1-, [ %terms ] )


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: $count #153899 24/07/06 10:14 AM
Joined: Jun 2004
Posts: 25
Q
Quia Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jun 2004
Posts: 25
Thanks qwerty, that did the trick.

Now I just feel stupid for forgetting that. grin