mIRC Home    About    Download    Register    News    Help

Print Thread
#79877 19/04/04 01:11 AM
Joined: Dec 2002
Posts: 266
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
...I just noticed this...

$scon(0) returns the number of connections
$scon(bob) returns the same number, as does...
$scon(fdsafafdsgafngfs)

The same applies to:
$chan(0) and $chan(gdsagbfadbdaf) but $chan(#dasbbadsb) returns nothing.

This meant to be a feature or a bug?


You won't like it when I get angry.
#79878 19/04/04 08:10 AM
Joined: Oct 2003
Posts: 12
E
Pikka bird
Offline
Pikka bird
E
Joined: Oct 2003
Posts: 12
if Khaled used atoi() to convert a string to an integer, bob will always return 0. (because there is no numeric char)

5bob should returns 5.

It's the same with $chan, but the algorithm must check first if the first letter is a #. If it is not, it converts the string to an int ( so "blahblah" becomes 0). Else it looks for the specified chan.


#79879 19/04/04 12:11 PM
Joined: Dec 2002
Posts: 266
Z
zack Offline OP
Fjord artisan
OP Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
Kinda stupid to do it this way, $scon(dsagfdsafsda) should be NULL.


You won't like it when I get angry.
#79880 19/04/04 06:35 PM
Joined: Oct 2003
Posts: 101
Vogon poet
Offline
Vogon poet
Joined: Oct 2003
Posts: 101
I agree it should be null, but I don't see how it could cause problems. Obviously if it's 0 then it could not be a valid connection.


Link Copied to Clipboard