closecnt=closecnt++;
ArrayResize(Closed,closecnt);
1) closecnt++ means closecnt is incremented AFTERWARDS but ++closecnt increments closecnt BEFORE the order is executed.
2) You don't need closecnt=closecnt++ or closecnt=++closecnt! closecnt++ or ++closecnt is all you need!
3) In your case you were able to write:
ArrayResize(Closed,++closecnt); // deleting this: closecnt=closecnt++;!!
1) where do you get this error?
2) Use Comment(__LINE__,..) to see the size and the request right before any array request as the last Comment(..) before the crash will remain on screen.
Sorry gooly can you give me an example of a comment line to request.. mql4 doc for is limited and states array can not be passed in comment function..? thanks
A comment pre and post ArrayResize is all see that can add value which confirms a 0 to 1 Array resize...
Sorry gooly can you give me an example of a comment line to request.. mql4 doc for is limited and states array can not be passed in comment function..? thanks
e.g. before the last line:
Comment(__LINE__," sz Opened[0] ",ArrayRange(Opened,0)," sz Opened[1] ",ArrayRange(Opened,1)); //now you'll see! Print("Opened[8] = ",Opened[8][1]);
If your code crashes at Print, Comment(..) is the last being executed!
Do it for all your array accesses with the correct array!
Thanks again.
52 sz Opened[0] 0 sz Opened[1] 12
So this suggests the Array is not being filled as opened[0] at the comment line should result 9 - correct ?
And obviously the array is not being filled as a result of the Array out of range error.
I had simplified my code in the provided example above and in doing so forgot to change the assignment of the second array parameter size. I have now corrected this as below however my problem still remains with the Array out of range error.
string Opened[][2],Closed[][2];
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Ok. Im at the end of my patience and am now putting my problem to the masses for support...... please.
The following test code is to solve a problem I am experiencing with a multi dimensional array. The first problem is that the ArrayResize function is not resizing the array (note my print result). Secondly I have the array out of range error on first loop pass at [50,11].
Any help is much appreciated, thanks.