mIRC Homepage
Posted By: drei $count - 14/04/03 05:27 PM
//echo > $count(hello there,$chr(32))

someone has probably already reported this, but to be on the safe side..

if there are more than one space in a text, it still only counts 1...
Posted By: KingTomato Re: $count - 14/04/03 05:32 PM
All cases of spaces, except if it is the terminating character (last character) are counter... Could you show an instance where this is proven otherwise?
Posted By: codemastr Re: $count - 14/04/03 07:06 PM
I think he means like "test test2" but I haven't tested...
Posted By: KingTomato Re: $count - 14/04/03 10:29 PM
To which you're referring "text<space><space>moretext" ? Just attepted it..

I first type:
/set %test text<space><space>text
then i typed
/echo > $count(%test, $chr(32))
output:
> 2
Posted By: drei Re: $count - 15/04/03 01:20 AM
hmm, it was like i thought.. html couldnt handle more than one space.. well..

$count(<space><space><space>,$chr(32)) SHOULD return 3, but only returns 1..

though in the other hand $count(aaa,a) returns 3..

thats what i ment.. sorry if i was unclear..
Posted By: KingTomato Re: $count - 15/04/03 01:24 AM
Well actually, consider mirc just like html. Any additional "whitespace" is just voiced. I mean its like having the decimal 0.10000000 or 0.1 Both mean exactly the same, so why keep the extended spaces.. Thats alteast the outlook of it anyways. grin
Posted By: _D3m0n_ Re: $count - 15/04/03 02:42 AM
also echo $count($chr(44)$chr(32)$chr(32),$chr(32)) returns 0 basically it only defines a space if it is presant in the begining and only defines it as being one no matter how many u have there
eg
echo $count($chr(44)$chr(32)$chr(32)$chr(44),$chr(32)) returns 0
eg
echo $count($chr(44)$chr(32)$chr(32)$chr(44),$chr(44)) returns only 1
actually this brings a whole new thing to show that the entire $count itself does infact have a major flaw in it
Posted By: codemastr Re: $count - 15/04/03 03:15 AM
Actually it doesn't, you do :P You forgot $+

//echo -a $chr(44)$chr(32)$chr(32)$chr(44)

prints , therefore $count was correct.

$count($chr(44) $+ $chr(32) $+ $chr(32) $+ $chr(44),$chr(32))

That will correctly return 2
Posted By: _D3m0n_ Re: $count - 15/04/03 03:18 AM
again i stand corrected ty ..... overlooked that lil thing
Posted By: NaquadaServ Re: $count - 16/04/03 12:09 PM
What else besides $count can handle double spaces? I didn't even think this was possible, so much mirc code simply can't deal with a double space....
Posted By: qwerty Re: $count - 16/04/03 12:29 PM
Actually only /commands cannot handle double spaces. All identifiers (built-in or custom) and variables can. Of course the spaces shouldn't be typed literally in the code, you need to use $chr(32) or something like $remove(a a a,a) etc.
Posted By: Nem3sis Re: $count - 22/04/03 03:49 PM
Quote:
$remove(a a a,a)

$str($chr(32),2) :P
© mIRC Discussion Forums