Download MetaTrader 5

ArraySort bug

To add comments, please log in or register
Publish your article and thousands of people all over the world will read it!
bearhu
5
bearhu 2010.06.17 23:47 

Hi!

 

I found a serious bug (?):

 

double    pbuffer[][2];  

....

....

ArraySort( pbuffer ); 

 

code drops 'pbuffer' - parameter conversion is not allowed Levels.mq5 106 16
 

 regards 

Paul
784
Paul 2010.06.18 11:03  
bearhu:

Hi!

 

I found a serious bug (?):

 

double    pbuffer[][2];  

....

....

ArraySort( pbuffer ); 

 

code drops 'pbuffer' - parameter conversion is not allowed Levels.mq5 106 16
 

 regards 

 

ArraySort() only works for one dimension arrays.  This makes sense, since with a 2D array it is not known what criterion should be used to declare that a whole row of numbers is greater or lesser than another row.

The ArrayObj class in the standard library could be used to define a 2D array that could be sorted.

 

 

To add comments, please log in or register