Function "isnull" isn't working properly for me.
#1

Hello, I have a little problem. I have defined isnull function. It works without any problem for usual string:
pawn Код:
new string[] = "Hello.";
if(isnull(string))
{
    //Works
}
But I want to check string like this, but it gives me compile error.
pawn Код:
if(isnull(cmdtext[i + 1]))
{
    //Compile errors
}
//Also this works:
if(!strlen(cmdtext[i + 1]))
{
    //Works
}
So, I have loop to check offset of params in command, and I want to check it, if it's null, but it gives me errors ^. Thanks.
Reply
#2

Because "isnull" checks if a given string is NULL and it does so cleverly by checking the first element of string, or the second (if it exists).
If you want to check if a given character is NULL take your pick:
PHP код:
new ch '\0';
if (
ch == '\0')
if (
ch == EOS)
if (
ch == 0)
// etc. 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)