Warning! - page 4

 
Soewono Effendi:

That's your assumption.

Refer to https://www.mql5.com/en/docs/basis/preprosessor/include and you'll read following:
" The preprocessor replaces the line #include <file_name> with the content of the file ..."

"#include" is a simple "text replacement".

As I said, know your tool not your "wish tool".

Please understand that I know the tool and I'm saying that it's a bad-designed tool because of all detailed explanations I posted above and I'm trying to make this tool better but you keep telling me I don't know the tool. The first time I compiled my first code I saw how this compiler works.

A simple text replacement is not enough and it's the time for MQL team to fix this.

The way it works is the source of many problems. Now go back and see how many times I said that.

When I say "the way it works" or "it mixes everthing", it means I know exactly what's going on.

I don't know based on what you think I don't understand my tool.


A global variable shouldn't be accessed by an included file Which means an included file shouldn't be a simple text replacement.
 
Ehsan Tarakemeh:

Ideally yes, but the problem is that the decision was made early on that #include would be a copypasta directive and nothing else. That means if it were to be changed now it would break countless programs. You're just going to have to stop fighting because that's a battle that cannot be won. We should instead focus on getting the namespace implementation fixed to work as documented so you can wrap your imports in a namespace to avoid all this mess that's driving you nuts. 

 
nicholish en:

Ideally yes, but the problem is that the decision was made early on that #include would be a copypasta directive and nothing else. That means if it were to be changed now it would break countless programs. You're just going to have to stop fighting because that's a battle that cannot be won. We should instead focus on getting the namespace implementation fixed to work as documented so you can wrap your imports in a namespace to avoid all this mess that's driving you nuts. 

I just found that it's not about text replacement. In MQL the order of declarations and using them is not important. You can define functions and variables and use them in any order you like. That’s why an included file has access to all declarations below itself.

Reason: