detecting null variable?
#1

I need to detect if a variable (string) is null or contains no data.

If it were javascript, it'd look like this:

var name = prompt ("Enter your name","") //prompts user for name; stores it in variable 'name'
if (name == null) //if name is null...
{
//execute this code
} else {
//otherwise execute this
}
Reply
#2

You would need to use the isnull( ) function. This one is found inside zcmd.inc, credits to ZeeX.
pawn Код:
#define isnull(%1) \
                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
Reply
#3

Awesome works perfectly Tyvm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)