question about comments in mql4/5 - page 2

 
Lorentzos Roussos:

declare the doubles outside the gates .you would get that issue with commenting out code too.

Thank you Lorentzos

I did.  I think filter/gates is not the best solution for what I am trying to do . Main reason if I put say 4 lines inside a gate they won't be accessible outside the gate when needed later , in the case above they will be needed. I think I am going to leave it as it is and not bother about loop producing only j+1 < or j+1+1<tfs results instead everything till j<tfs.

I get what you are saying about commenting . If i could comment out the 'offending ' lines I will comment out the block of lines where those variables appear(and are not needed) so not to have any errors.

Have you had any experience using conditional compilation ?

https://www.mql5.com/en/docs/basis/preprosessor/conditional_compilation

It would be interesting to find out how it is implemented . The mql4 documentaion does not have lot of examples.


thank you again

Documentation on MQL5: Language Basics / Preprocessor / Conditional Compilation (#ifdef, #ifndef, #else, #endif)
Documentation on MQL5: Language Basics / Preprocessor / Conditional Compilation (#ifdef, #ifndef, #else, #endif)
  • www.mql5.com
Each directive is described by a separate entry and is valid until the line break. You cannot use several directives in one entry. If the directive entry is too big, it can be broken into several lines using the '\' symbol. In this case, the next line is considered a continuation of the directive entry. Preprocessor conditional compilation...
 
>>> conditional compilation

as it says, it compiles (read: composes, includes) parts of source codes during compilation time only.
After that, i.e. during runtime, the "not compiled/included code" are not available anymore, they are "excluded/thrown away".

*not sure if this is what  you need.
 
Soewono Effendi:
>>> conditional compilation

as it says, it compiles (read: composes, includes) parts of source codes during compilation time only.
After that, i.e. during runtime, the "not compiled/included code" are not available anymore, they are "excluded/thrown away".

*not sure if this is what  you need.

not for me .thank you for clarifying . good to know .

Reason: