This function returns whether a given variable is a pointer or not. In some cases you want to check and see what data type a variable holds in GameMaker and that's when you would use this function. It returns true or false depending on whether the value is a pointer or not.
is_ptr(n);
Argument | Type | Description |
---|---|---|
n | Any | The argument to check. |
if (!is_ptr(val))
{
show_debug_message("Not a valid texture!");
}
The above code checks the variable "val" to see if it contains a pointer and if it is not then it shows a message in the debug console.