Using "arrays" as input of functions - page 2

 
Alain Verleyen:

This is not working as the type is always the same.

I don't think it can be done in mql.

It can be done,this works fine - the problem is dynamic second and third dimensions are not allowed, just fixed 
void func(double &array[])
  {
   Print("1D");
  };
void func(double &array[][3])
  {
   Print("2D");
  };
void func(double &array[][4][5])
  {
   Print("3D");
  };

// use with 1D
double arr[];
double arr2[][3];
double arr3[][4][5];
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
func(arr);
func(arr2);
func(arr3);
  }
The rssult printed: 
1D
2D
3D
So, @parham.trader  I don't see how you say the initial version you have works dynamically [][][] (and not [][4][5] - static)
because to me that line is not compiled
func(double &array_to_show_1D[],double &array_to_show_2D[][],double &array_to_show_3D[][][])
 

Use structures

Something like this - just an example to show how each and every "element" of such and array can have its own size :

   struct sFirstDim
   {
      double array[];
   };
   struct sSecondDim
   {
      sFirstDim array[];
   };
   static sSecondDim m_array[];
      ArrayResize(m_array,100);
      ArrayResize(m_array[0].array,100);
      ArrayResize(m_array[0].array[0].array,100);
         Comment(ArraySize(m_array),"    ",ArraySize(m_array[0].array[0].array),"    ",ArraySize(m_array[0].array[1].array));
 
Amir Yacoby:
It can be done,this works fine - the problem is dynamic second and third dimensions are not allowed, just fixed  The rssult printed: 
1D
2D
3D
So, @parham.trader  I don't see how you say the initial version you have works dynamically [][][] (and not [][4][5] - static)
because to me that line is not compiled
You are right but how this can be useful with fixed dimensions ? Anyway...
 
parham.trader:

So how does "FileWriteArray" work properly?

FileWriteArray() is a mql function but is not coded in mql, but in C++.
Reason: