i want a function to return a number and to print it in the journal.

 

IF (something == something) return (this); <-- where do i add a Print ("this")?

im having trouble adding the print part alongside the return call.

any help?


code:

if (X==Z) return (0) ; else  X=Y(); // Print ("WUT")
    
 
IF (something == something) {Print ("this");return (this);} <-- where do i add a Print ("this
 
Aleksei Beliakov:
IF (something == something) {Print ("this");return (this);} <-- where do i add a Print ("this
I really need yo wrap my head around the brackets.
Thanks, works like a charm.
 
step by step day by day you get it all
 
Aleksei Beliakov:
step by step day by day you get it all

thanks again. now i start to understand the deal with brackets.

also, now i hum the intro song from the TV series "step by step" - no thanks for that.


cheers.

 
One thing to remember about MQL, it is close in style to C++ (now anyway), and that style of programming relies heavily on brackets to contain bits of code.  Some programmers will even bracket one line of code, even though it serves no programming function whatsoever.  They do so to make it easier to track visually, and also, if they add code later, to ensure it is already contained where it needs to go.
Reason: