int myArray[20];
int start(){
myArray[10]={2}; // this is not how you assign a value; it can only be used as an initialiser list//myArray[10]= 2; // this is the correct assignmentComment("my array 10 is " + myArray[10]);
return(0);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
In 2009.10 I had coded:
And it wouldn't compile; said something like array index must be an integer.
Perhaps my comment is no long true.
No, it's still true. Raptor evidently tried it - and so did I :-)
The error message was included in Raptor's earlier post.
Am missing something really basic…
YES!
test script ...
PFUNK:
Ok, So I've lost the OrdersHistoryTotal(); … but still getting 0 on Alert ouput. Am missing something really basic…
I have a question for you,just to clarify.... is this really what you want to do ?
Create an array and use the array element with the index equal to the amount of closed orders ?
example:
Total amount of closed orders returned by OrdersHistoryTotal() is 500
Therefore use the array element: myarray[500]
Then assign to that array element the value: 11
The reason I ask, that is what your original code was attempting to do I was just wondering if that really was the intention ....