is_undefined


Description

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 2 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.


Syntax:

is_undefined(n);


Arguments:

Argument Description
n The argument to check.


Returns:

Boolean


Example:

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.