array_length_1d

Returns the length of the first dimension of an array.

Syntax:

array_length_1d(array);


Argument Description
array The array to check.


Returns: Real


Description

With this function you can get the length (number of entries) of a 1D array. For 2D arrays you should be using the array_height_2d and array_length_2d functions.

WARNING!: If the array has over 32,000 entries this function will return an erroneous value and should not be used.


Example:

for (var i = array_length_1d(a) - 1; i > -1; i--;)
   {
   a[i] = -1;
   }

The above code will loop through an array and set each entry to -1.


Back: Arrays
Next: array_length_2d
© Copyright YoYo Games Ltd. 2018 All Rights Reserved