Comments
Comments are pieces of a text used to annotate a program, and are technically another form of whitespace. Comments are for the programmer’s use only. They are stripped from the source text before parsing.
There are two ways to create comments in mikroPascal. You can use multi-line comments which are enclosed with braces or (*
and *)
:
{ All text between left and right brace constitutes a comment. May span multiple lines. } (* Comment can be written in this way too. *)
or single-line comments:
// Any text between a double-slash and the end of the // line constitutes a comment spanning one line only.
Nested comments
mikroPascal PRO for PIC doesn’t allow nested comments. The attempt to nest a comment like this
{ i { identifier } : word; }
fails, because the scope of the first open brace “{
” ends at the first closed brace “}
”. This gives us
: word; }
which would generate a syntax error.
Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
What do you think about this topic ? Send us feedback!