mIRC Homepage
Posted By: zack Call me stupid but... - 19/04/04 01:11 AM
...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?
Posted By: Epsilon Re: Call me stupid but... - 19/04/04 08:10 AM
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.
Posted By: zack Re: Call me stupid but... - 19/04/04 12:11 PM
Kinda stupid to do it this way, $scon(dsagfdsafsda) should be NULL.
Posted By: root66 Re: Call me stupid but... - 19/04/04 06:35 PM
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.
© mIRC Discussion Forums