is_undefined(n);
Argument | Description |
---|---|
n | The argument to check. |
Returns: Boolean
This function returns whether a given variable is defined or
not. In some cases you want to check and see what data type a
variable holds in GameMaker: Studio and that's when you
would use this function. It returns true or false
depending on whether the value is defined or not. For further
information on data types see here.
var val = ds_map_find_value(map, 13);
if is_undefined(val)
{
show_debug_message("Map entry does not
exist!");
}
The above code checks the variable "val" to see if it is undefined or not and shows a debug message if it is.