Skip to main content

The "ds_struct_find_next" Function

Syntax#

ds_struct_find_next(id, key);
ArgumentTypeDescription
idstructThe struct to check
keystringThe key (i.e. struct content) to begin search from

Description#

Returns the name of the next key in the given struct, as a string. Search will begin from the given key (for example, as returned by ds_struct_find_first).

If the struct is empty or no further key exists, 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_first(my_struct);
key = ds_struct_find_next(my_struct, key);
var val = true;
variable_struct_set(my_struct, key, val);