MQL4 Reference Array Functions ArrayDimension

ArrayDimension

Returns the multidimensional array rank.

int  ArrayDimension(
   void&  array[]           // array
   );

Parameters

array[]

[in]  Array for which the rank will be returned.

Returned value

Rank (dimension) of multidimensional array or  -1 if error.

Example:

void OnStart()
  {
   int num_array[10][5];
   int dim_size=ArrayDimension(num_array);// dim_size=2
   Print("Dimension of num_array=",dim_size); 
  }