ds_list_find_index(id, val);
Argument | Description |
---|---|
id | The id of the list to use. |
val | The value to find. |
Returns: Real
With this function you can check the given list for a value and the position within the list for that value will be returned. Note that if there are more than one entries in the list with the same value, the position of any one of them may be returned, and that if the value does not exist, then -1 will be returned.
NOTE: If the list index that you wish to find is an array value, the function will return -1.
pos = ds_list_find_index(list, "Player1");
The above code checks the list indexed in the variable "list" for the value "Player1" and stores the returned position in the variable "pos".