Enum into own file in mql5
Enum into own file in mql5
Loading saved threads...
Sadegh Molaei · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Sadegh Molaei
Original post: https://stackoverflow.com/questions/78671482
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
i want use own enum file (enum.ex5) into (middle.ex5) and (last.ex5).
i can use #include instead of #import but i want use #import.
for exmaple :
- enum file "enum.ex5"
(i dont like use this file into #include)
enum ENUM_VALUE
{
VAL_1,
VAL_2,
VAL_3,
};
- middle file "middle.ex5"
#property library
ENUM_VALUE test (bool access) export
{
if (access == true)
return VAL_1;
else if (access == false)
return VAL_2;
return VAL_3;
}
- last file "last.ex5"
#import "middle.ex5"
ENUM_VALUE test (bool access);
#import
thanks.
Quote
Report
Daniel Kniaz · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: Daniel Kniaz
Original post: https://stackoverflow.com/a/78674175
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
#
import
in MQL45 is used to import methods (functions) from compiled libraries (dll, native ex5, c#). It is not used to import classes, enums and interfaces.
So you have to use #include
Quote
Report
Post Reply
Checking account access…