Tutorial On Basic Concepts Of Mql-Comments

Comments

In the sea of coding, comments in MQL4 comes in handy to explain a part of the mark up language or to block a part of coding for testing and debugging. Comments avoid the process of deleting and re-entering the code while testing. It is like a temporary and desired switch off. It is very much useful in documentation as the programmer could explain the coding in plain English.

MQL programming tutorial by Wetalktrade-type of comment

MQL programming tutorial by Wetalktrade-type of comment

 

There are two ways of entering comments:

1) Single Line Comments; and
2) Multi-Line Comments.

Single Line Comment Syntax
// We have made a comment

Multi-Line Comment Syntax
/* we are going to block out a bunch of code */

Comments are preceded by ‘/*’ and end with ‘*/’.

This form of commenting is for quickly disabling many lines of code all at once, instead of having to put two forward slashes at the beginning of every line like the first method. When you have a bunch of code to block out, multi line comment is the better option as it avoids the repeated process of putting the double forward slash at the beginning of every line