Varying size of an array
alladir:
You have to use a dynamic array, and the ArrayResize() function.
At the moment I'm creating an array with 7 entries like this:
But I'd like to put the code in a .mqh file and then #include it in many files, with different sizes of the array.
I tried to do this:
but it doesn't compile:
"integer number expected".
Is it possible to do this somehow?
Excellent, thanks! :D
You cant initialize an array with a variable.
At the moment I'm creating an array with 7 entries like this:
But I'd like to put the code in a .mqh file and then #include it in many files, with different sizes of the array.
I tried to do this:
but it doesn't compile:
"integer number expected".
Is it possible to do this somehow?