Download MetaTrader 5

Does an Array have the maximum limit of dimension?

To add comments, please log in or register
moonsboy
889
moonsboy  

 Does an Array have the maximum limit of dimension?

I can't find it in the help instruction.  Is it mentioned in the help instruction?

honest_knave
Moderator
2433
honest_knave  

According to the documentation here:

The maximum admissible amount of dimensions in an array is four
moonsboy
889
moonsboy  
honest_knave:

According to the documentation here:

The maximum admissible amount of dimensions in an array is four


Sorry for my wrong expression.

I mean the maximum limit of one dimension Array.  I can't find it in the help instruction.  Is it mentioned in the help instruction?

Keith Watford
Moderator
9641
Keith Watford  

I think that it is 100 million for globally declared arrays

There is a 512kb limit on the amount of memory assigned to locally declared variables, so it could depend on what the array is storing.

moonsboy
889
moonsboy  
GumRai:

I think that it is 100 million for globally declared arrays

There is a 512kb limit on the amount of memory assigned to locally declared variables, so it could depend on what the array is storing.

 

 

Thank you. May I know where you got it?
Keith Watford
Moderator
9641
Keith Watford  
jollydragon:
Thank you. May I know where you got it?
I got an error when compiling some code with a very large Array range one time. As the error stated that it was too large for a locally declared variable, I tried declaring it globally and found that there was no error. Just out of curiosity I tried a larger array size until I found that 100 million was the maximum.
moonsboy
889
moonsboy  
GumRai:
I got an error when compiling some code with a very large Array range one time. As the error stated that it was too large for a locally declared variable, I tried declaring it globally and found that there was no error. Just out of curiosity I tried a larger array size until I found that 100 million was the maximum.

 

Thank you very much for the sharing.  

To add comments, please log in or register