Skip to main content

The "ds_struct_find_last" Function

Syntax#

ds_struct_find_last(id);
ArgumentTypeDescription
idstructThe struct to check

Description#

Returns the name of the last key in the given struct, as a string. Further searches can then be performed with ds_struct_find_previous.

If the struct is empty, undefined will be returned instead.

Note that because structs are a non-ordered data format, data may be returned in a different order than originally declared in code. Changes to the struct may also change the order in which data is returned with this function.

Example#

var key = ds_struct_find_last(my_struct);
var val = true;
variable_struct_set(my_struct, key, val);