Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENUM_MARKET_CONDITION' - declaration without type ea-input.mqh #58

Closed
kenorb opened this issue Aug 27, 2019 · 2 comments
Closed

ENUM_MARKET_CONDITION' - declaration without type ea-input.mqh #58

kenorb opened this issue Aug 27, 2019 · 2 comments
Labels
bug MQL5 MQL5 compability

Comments

@kenorb
Copy link
Member

kenorb commented Aug 27, 2019

ENUM_MARKET_CONDITION' - declaration without type ea-input.mqh 96 8

This errors in ME build 5.0.0.2122, but not in 5.0.0.1966.

@kenorb kenorb added bug MQL5 MQL5 compability labels Aug 27, 2019
@kenorb
Copy link
Member Author

kenorb commented Aug 27, 2019

Since the new build of MQL5 compilator, class enums are now needs to be explicitly referenced, e.g. Condition::ENUM_MARKET_CONDITION instead of ENUM_MARKET_CONDITION. This makes the syntax not back compatible.

For example:

MQL4:

struct A {
   enum bla {
      A, B, C
   };
};

bla x = C;

MQL5:

struct A {
   enum bla {
      A, B, C
   };
};

bla x = A::bla::C;

The workaround is to move the enums outside of the class.

@kenorb
Copy link
Member Author

kenorb commented Aug 30, 2019

Fixed in #60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug MQL5 MQL5 compability
Projects
None yet
Development

No branches or pull requests

2 participants