Download MetaTrader 5

'extend' the line?

To add comments, please log in or register
Publish your trading signal. Gain access to millions of traders!
Carl Schreiber
6590
Carl Schreiber 2015.11.11 20:47 

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
3151
Ex Ovo Omnia 2015.11.12 08:45  
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
6590
Carl Schreiber 2015.11.12 09:55  
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