Hi,
when I declare a variable in a included file, if this var is called of a included file loaded from it, the compiling fails, examples...
THIS WORKS FINE
Script...
<CODE REMOVED>
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
Maybe this will help: https://www.mql5.com/en/forum/116773
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
Maybe this will help: https://www.mql5.com/en/forum/116773
Hi,
the post is edited I hope it's right now
thanks for all,
Those are include files, not libraries. Remove the #property
Hi,
Sorry, I have shown only fracments of the code for the example, (the #property library compiling command is necesary to use in the code of my include files and the use of this command I think is not limited to mq4 type files) and it is not have relevance in this problem.
Thank you
Hi,
I have encountered the solution !!! :)
Replacing the code of the include1.mqh with...
bool CHECK=true; #include <include2.mqh>
Finally, the phrase "The #include command line can be placed anywhere in the program" can be wrong in the documentation https://docs.mql4.com/basis/preprosessor/include
the compiler seems that not works very fine ;)
Thanks at all
Hi,
I have encountered the solution !!! :)
Replacing the code of the include1.mqh with...
Finally, the phrase "The #include command line can be placed anywhere in the program" can be wrong in the documentation https://docs.mql4.com/basis/preprosessor/include
the compiler seems that not works very fine ;)
Thanks at all
The #include may be place anywhere in the code. Nevertheless anywhere does not mean randomly.
Hi,
I have encountered the solution !!! :)
Replacing the code of the include1.mqh with...
Finally, the phrase "The #include command line can be placed anywhere in the program" can be wrong in the documentation https://docs.mql4.com/basis/preprosessor/include
the compiler seems that not works very fine ;)
Thanks at all
In this particular case the compiler works very fine, you can't use a variable before you declare it.
#include is a directive for the preprocessor, not the compiler.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
when I declare a variable in a included file, if this var is called of a included file loaded from it, the compiling fails, examples...
THIS WORKS FINE
Script...
file include1.mqh...
file include2.mqh...
THIS FAILS, error... 'CHECKSW' - variable not defined
Script...
file include1.mqh...
file include2.mqh...
Anyone can help me?
Thanks