Download MetaTrader 5

New compiler at MQL4?

To add comments, please log in or register
desert
191
desert  

Hi

After some months away of MQL4 programming, today I have compiled a code which was working perfectly before (9 months), but now I got a compiling error.

This is the code line:

switch(Orders[index,1])

Orders is defined like this:

double
Orders[100,12];


The error is this one:

'Orders' - ilegal switch expression type


As mentioned before, this error is new, it worked ok previously, was it an update in MQL4? any help on the error?

Thanks

Alain Verleyen
Moderator
33359
Alain Verleyen  
desert:

Hi

After some months away of MQL4 programming, today I have compiled a code which was working perfectly before (9 months), but now I got a compiling error.

This is the code line:

switch(Orders[index,1])

Orders is defined like this:

double
Orders[100,12];


The error is this one:

'Orders' - ilegal switch expression type


As mentioned before, this error is new, it worked ok previously, was it an update in MQL4? any help on the error?

Thanks


Switch operator works with integer only.
Keith Watford
Moderator
10645
Keith Watford  
You can only use integers with switch now
desert
191
desert  

Ok, I see, thanks for your answers.

I have tested this with an old metaeditor, it compiles without errors.

Could I use that expert advisor in the new Mt4 version? Any posible issue with that?


Thanks again guys.

Alain Verleyen
Moderator
33359
Alain Verleyen  
desert:

Ok, I see, thanks for your answers.

I have tested this with an old metaeditor, it compiles without errors.

Could I use that expert advisor in the new Mt4 version? Any posible issue with that?


Thanks again guys.

It should work.
To add comments, please log in or register