Comments and Compiler Directives

Comments are ignored by the compiler, except when they function as separators (delimiting adjacent tokens) or compiler directives.

There are several ways to construct comments:

  • Text between a left brace and a right brace constitutes a comment. }
  • Text between a left-parenthesis-plus-asterisk and an asterisk-plus-right-parenthesis is also a comment *)
  • Any text between a double-slash and the end of the line constitutes a comment.

Comments that are alike cannot be nested. For instance, {{}} will not work, but (*{}*) will. This is useful for commenting out sections of code that also contain comments.

A comment that contains a dollar sign ($) immediately after the opening { or (* is a compiler directive. For example,


tells the compiler not to generate warning messages.

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment