The Example given from the "ArrayDimension" MQL Help page clearly shows an array of integers being created (2-dimensional, even).
void OnStart() { int num_array[10][5]; int dim_size=ArrayDimension(num_array);// dim_size=2 Print("Dimension of num_array=",dim_size); }
Is my error the fact that I created it in the global scope? (I didn't think that would be a problem).
Hi,
When I try to create an Array Buffer of type 'int' I get the compilation error "'SetIndexBuffer' - no one of the overloads can be applied to the function call":
However, if I change the array type to 'double' it compiles, like so:
Questions:
1. Why does the 'int' form fail compilation?
2. Which data types can I create an array of? I thought I could create arrays of many types, e.g. double, int, string, bool, etc.
3. If I have the wrong syntax to create an int array[], how do I do it correctly?
Thanks.
Buffer arrays have to be type double
You can have integer arrays just not for use as buffers
https://docs.mql4.com/customind/setindexbuffer

- docs.mql4.com
Buffer arrays have to be type double
You can have integer arrays just not for use as buffers
https://docs.mql4.com/customind/setindexbuffer
Thank you Paul...so it seems I am yet to learn the difference between an Array and a Buffer...
Guess I have some more reading to do.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
When I try to create an Array Buffer of type 'int' I get the compilation error "'SetIndexBuffer' - no one of the overloads can be applied to the function call":
However, if I change the array type to 'double' it compiles, like so:
double BufferIndex[];
Questions:
1. Why does the 'int' form fail compilation?
2. Which data types can I create an array of? I thought I could create arrays of many types, e.g. double, int, string, bool, etc.
3. If I have the wrong syntax to create an int array[], how do I do it correctly?
Thanks.