Comment In Microsoft Dynamics NAV
What is a Comment?
Comment is the useful information to identify or represent a programming code.
The comment statements are not executable so we can comment the programming codes that no need to execute also.
Types Of Comments
Mainly 3 types of comments available in the Microsoft Dynamics NAV C/AL.
- Single Line Comment
- Block Of Comment
- Nested Comments
- Single Line Comments :- Single line comments are types of comments that can used to comments single line of codes. In this case, this single line comment ignore by the compiler. The Syntax used is '//'. ie, if we are placing // in any of the program codes then after that text is consider to be comment.
For Example:
================================================
//Sample code for Comment showing adding two numbers
A := B + C;
================================================
- Block Of Comment:- Block comments are comments that allow multiline comment. Block comments start with '{' bracket and closing with '}'. ie, the text between these brackets are considered as comment portion and this cannot be repeated.
For Example:
================================================
//Sample Block comment
{
text1........
text2......
text3
}
================================================
- Nested Comments:- Nested Comments are types comments that represent comments in the form, a comment containing another comment. ie, the brackets of '{' is started but inside of that also another '{' rather than '}'.
For example :
================================================
//Nested Comment
{
text1........
{
text2......
text4..................
}
text3
}
================================================