|
Often there is the need to add comments to the code to make it clearer. The programming language allows to insert comments anywhere in the code. The comment must begin with a single quote mark ( ' ).
Let's see how the code looks with some comments in it.
Function MC ( PP As Numeric, UP As Numeric ) As Numeric
' This function calculate the average close from PP a UP
Dim I As Numeric = 0 ' Here the default value is 0 Dim A As Numeric Dim S As String = "M"
I = UP - PP + 1
Return CalcMove(Close, I)
EndFunction
In fact everything that follows the single quote on the same line is considered to be a comment and it will be ignored while the code is executing.
If you haven't already noticed it comments appear different in the code. The language keywords are always shown in blue color. Comments are always shown in green color. Therefore it is immediate to distinguish the comments from the rest of the code.
|