array_get


Description

With this function you can retrieve the value from an index in a 1D array. The function requires you to provide a varaiable that hoilds the array and the index to get the value from within that array. Note that if the array index given is out of bounds then the game will crash with an error.


Syntax:

array_get(variable, index);

Argument Description
variable The variable that holds the array.
index The index of the array to get the value from.

Returns:

Any valid data type that an array can hold.


Example:

for (var i = 0; i < 10; ++i;)
    {
    show_debug_message(array_get(my_array, i));
    }

The above code will output the first 10 items of the given to the console.