mIRC Home    About    Download    Register    News    Help

Print Thread
$count #19216 14/04/03 05:27 PM
Joined: Dec 2002
Posts: 19
D
drei Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2002
Posts: 19
//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...

Re: $count #19217 14/04/03 05:32 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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?


-KingTomato
Re: $count #19218 14/04/03 07:06 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
I think he means like "test test2" but I haven't tested...

Re: $count #19219 14/04/03 10:29 PM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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


-KingTomato
Re: $count #19220 15/04/03 01:20 AM
Joined: Dec 2002
Posts: 19
D
drei Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Dec 2002
Posts: 19
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..

Re: $count #19221 15/04/03 01:24 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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


-KingTomato
Re: $count #19222 15/04/03 02:42 AM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
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


D3m0nnet.com
Re: $count #19223 15/04/03 03:15 AM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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

Re: $count #19224 15/04/03 03:18 AM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
again i stand corrected ty ..... overlooked that lil thing


D3m0nnet.com
Re: $count #19225 16/04/03 12:09 PM
Joined: Dec 2002
Posts: 580
N
NaquadaServ Offline
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
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....


NaquadaBomb
www.mirc-dll.com
Re: $count #19226 16/04/03 12:29 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: $count #19227 22/04/03 03:49 PM
Joined: Dec 2002
Posts: 29
N
Nem3sis Offline
Ameglian cow
Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 29
Quote:
$remove(a a a,a)

$str($chr(32),2) :P