Download MetaTrader 5

'extend' the line?

To add comments, please log in or register
Carl Schreiber
Moderator
7964
Carl Schreiber  

Hi,

is there a way in the mql4-editor to 'extend' the line?

Hear is what what I mean:

#define checkA(var,lim1,lim2) var>lim1 ? 1 : var<lim2 ? -1 : 0 // this is accepted by the compiler
// this not:
#define checkB(var,lim1,lim2)     var>lim1 ?  1 
                                : var<lim2 ? -1 
                                : 0                // this is NOT accepted by the compiler

I would prefer for the readability  checkB()  but the mt4 compiler refuses this:

':' - expressions are not allowed on a global scope     dummy_2.mq4     32      1

I would need a char the signals the compiler to add the next line to the previous one.

Does this exist?

Ex Ovo Omnia
3423
Ex Ovo Omnia  
calli:

Hi,

is there a way in the mql4-editor to 'extend' the line?

Hear is what what I mean:

I would prefer for the readability  checkB()  but the mt4 compiler refuses this:

I would need a char the signals the compiler to add the next line to the previous one.

Does this exist?

Usually a trailing backward slash is used for extending a line in most editors.
Carl Schreiber
Moderator
7964
Carl Schreiber  
Ovo Cz:
Usually a trailing backward slash is used for extending a line in most editors.

Yes - thanks, it works:

#define checkB(var,lim1,lim2)     var>lim1 ?  1 \
                                : var<lim2 ? -1 \
                                : 0                // this is NOW accepted by the compiler

I couldn't find anything in the reference and I didn't remember what char it was - just there might be one.

Thanks!

To add comments, please log in or register