ds_list_find_value

Finds the value held at a given position in the list.

Syntax:

ds_list_find_value(id, pos);


Argument Description
id The id of the list to use.
pos The position to look at, where 0 corresponds to the very beginning of the list and the final position is ds_list_size(id)-1.


Returns: Real, String or Undefined


Description

With this function you can check the given list position and the value held within the list for that position will be returned.

NOTE: If you give a position that is outside of the given list size (ie: position 11 in a 10 value list) then the function will return <undefined>. You should always check this using the is_undefined() function.


Example:

val = ds_list_find_value(list, ds_list_size(list) - 1);

The above code checks the list indexed in the variable "list" at the last position in the list and stores the returned value in the variable "val".


Back: DS Lists
Next: ds_list_insert
© Copyright YoYo Games Ltd. 2018 All Rights Reserved