Programmer's Guide: Comments inside directives

Summary

The documentation doesn't mention comments inside directives.

Examples

{$warn 5023 off : no warning about unused units} // after "off" comment
{$if defined(define1) or defined(define2)} // both conditions are checked
{$if defined(define1)    defined(define2)} // only 'define1' is checked, the rest is considered a comment
{$if defined(define1)}    // 'defined(define1)' is condition
{$else defined(define1)}  // 'defined(define1)' is comment
{$endif defined(define1)} // 'defined(define1)' is comment

Source

Wiki articles can be used as a source, for example: https://wiki.freepascal.org/Conditional_compilation.

Pages to edit

Edited by n7800