How effectively organize rows array ascending/descending?

[Deleted]  

Hi guys,

example: I have array int Test [10] [10]  and I need sorte (ascending/descending) array rows

sometime: a) by the 1th column   for it I can use: 

ArraySort ( Test, WHOLE_ARRAY, 0, MODE_DESCEND );

                 b) by the 3rd column    How is effectively code for it?

Thank you. 

 
You have to write one:
Not Compiled, not tested.
#define ASCENDING    +1
#define DESCENDING   -1
void ArraySort2D(double& arr[][],int eSel=0,double asc=1,int nRows=WHOLE_ARRAY){
   if(nRows == WHOLE_ARRAY)   nRows = ArrayRange(arr,0);
   int nCol = ArrayRange(arr,1);
   double tmpRow[];  ArrayResize(tmpRow, nCol)
   for(int iRow = 1; iRow < nRows; iRow++){                            // Insertion sort.
      for(int iCol = 0; icol < ncol; iCol++)     tmpRow[icol] = arr[iRow][icol]
      for(int iEmpty = iRow; iEmpty > 0; iEmpty--){
         if( (arr[iEmpty-1][eSel] - tmpRow[eSel)*asc <= 0.) break;
         for(int iCol = 0; icol < nCol; iCol++)  arr[iEmpty][iCol] = arr[iEmpty-1][iCol];
      }
      for(int iCol = 0; icol < nCol; iCol++)     arr[iEmpty][iCol] = tmpRow[iCol]; // Insert
   }  // iRow
}  // ArraySort2D
Not Compiled, not tested.

See also my code Why is there NO Complete EA within the Code-Base? - MQL4 forum and Could EA Really Live By Order_History Alone? - MQL4 forum