Still an issue - not solved!
I was looking for the same, and found the official solution from Metaquotes...
I am posting here to help out the next one searching for it.
https://www.mql5.com/en/docs/standardlibrary/datastructures/carraystring/carraystringinsertsort
This link to the documentation shows a function called InsertSort... with no documentation to .Sort, but you can see it in the example for the InsertSort on the link above.
On top of that, the entire library is appropriate for string arrays... Enjoy!
I am posting here to help out the next one searching for it.
https://www.mql5.com/en/docs/standardlibrary/datastructures/carraystring/carraystringinsertsort
This link to the documentation shows a function called InsertSort... with no documentation to .Sort, but you can see it in the example for the InsertSort on the link above.
On top of that, the entire library is appropriate for string arrays... Enjoy!
//--- example for CArrayString::InsertSort(string) #include <Arrays\ArrayString.mqh> //--- void OnStart() { CArrayString *array=new CArrayString; //--- if(array==NULL) { printf("Object create error"); return; } //--- add arrays elements //--- . . . //--- sort array array.Sort(); //--- insert element if(!array.InsertSort("ABC")) { printf("Insert error"); delete array; return; } //--- delete array delete array; }
Documentation on MQL5: Standard Library / Data Collections / CArrayString / InsertSort
- www.mql5.com
InsertSort(string) - CArrayString - Data Collections - Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
TheCoder #:
I was looking for the same, and found the official solution from Metaquotes...
I am posting here to help out the next one searching for it.
https://www.mql5.com/en/docs/standardlibrary/datastructures/carraystring/carraystringinsertsort
This link to the documentation shows a function called InsertSort... with no documentation to .Sort, but you can see it in the example for the InsertSort on the link above.
On top of that, the entire library is appropriate for string arrays... Enjoy!
I was looking for the same, and found the official solution from Metaquotes...
I am posting here to help out the next one searching for it.
https://www.mql5.com/en/docs/standardlibrary/datastructures/carraystring/carraystringinsertsort
This link to the documentation shows a function called InsertSort... with no documentation to .Sort, but you can see it in the example for the InsertSort on the link above.
On top of that, the entire library is appropriate for string arrays... Enjoy!
That's really handy to know - thanks
Unfortunately I spent time writing one before I read this!! LOL
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
now, it return the result: 'ArraySort' - constant cannot be modified.
But, before build 2485, string array can be sort.