Download MetaTrader 5

Possible error with ArrayResize in current version (Build 600) - page 2

To add comments, please log in or register
Slava
Moderator
6961
Slava  
angevoyageur:

mql5 produce a warning :

Cannot be used for static allocated array Test.mq5 22 4

Reported to ServiceDesk.

Please don't mix MQL4 and MQL5

There are no static allocated arrays in the MQL4

Exception is array with known size in the structure

ydrol
590
ydrol  

@stringo I think angevoygeur is verifying the mql5 compiler issues a warning for a condition where the mql4 compiler just fails silently. Thus the mql4 issue is wrong behaviour, and is reported to service desk.

Slava
Moderator
6961
Slava  
ydrol:

@stringo I think angevoygeur is verifying the mql5 compiler issues a warning for a condition where the mql4 compiler just fails silently. Thus the mql4 issue is wrong behaviour, and is reported to service desk.



What is the wrong behavior of mql4 compiler?
ydrol
590
ydrol  

From MQL4 ArrayResize documentation "The function can be applied only to dynamic arrays. "

If accidentally applied to static arrays then MQL4 compiler does not report an error, and the program behaves oddly. Mql5 compiler does report the error.

PS All info is there in the thread :)

Ilyas
1205
Ilyas  
exverxes:

Communication with DLL doesn't work as it should. Here are two code samples:

...

Why?

Thank you for your message. Fixed, please wait for updates.
In the current build you should use dynamic arrays in DLL calls.
12
To add comments, please log in or register