Shoutbox

if (strcmp(sCommandArg, "") == 0), which it never does... - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: if (strcmp(sCommandArg, "") == 0), which it never does... (/showthread.php?tid=18438)

if (strcmp(sCommandArg, "") == 0), which it never does... by RaceProUK on 11-21-2003 at 09:46 PM

Can someone please help me figure out why

code:
if (strcmp(sCommandArg, "") == 0)
never evaluates to 'TRUE'?
*-)
Or do I just not know how to use pointers properly?
RE: if (strcmp(sCommandArg, "") == 0), which it never does... by dilated on 11-21-2003 at 10:48 PM

u need to rectify the variable


RE: if (strcmp(sCommandArg, "") == 0), which it never does... by Meksilon on 11-22-2003 at 02:12 AM

Probably because Patchou rejects commands with no param if it's supposed to have one.


RE: if (strcmp(sCommandArg, "") == 0), which it never does... by RaceProUK on 11-22-2003 at 03:12 PM

I seem to have forgotten to mention sCommandArg is a pointer.

quote:
u need to rectify the variable

How?

quote:
Probably because Patchou rejects commands with no param if it's supposed to have one.

I have tested this, and I found that when no argument is supplied, *sCommandArg is the NULL character.
RE: if (strcmp(sCommandArg, "") == 0), which it never does... by RaceProUK on 11-25-2003 at 10:10 AM

if (strlen(sCommandArg) == 0), which it does with no arguments. I should have used that to start off with really.