What is the difference in Delphi between using {.$DEFINE VAR} and {$DEFINE VAR} compiler directives ?
Asked
Active
Viewed 411 times
4
-
4It's an idiom for configuration files. All possible defines are listed with dot turning it into a comment (no effect). Remove dots where you need an option and you have "flipped a switch" – Warren P Mar 28 '13 at 01:15
-
1Have a look at `FastMM4Options.inc` if you have Fast MM installed. It is full of these! – Gerry Coll Mar 28 '13 at 01:19
2 Answers
8
The code originally had a {$DEFINE VAR}
statement in it, then a period was added to turn the statement into a plain ordinary comment without removing the statement, presumably so it can be restored at a later time.
{$...}
is a precompiler directive.
{...}
that does not start with {$
is a comment.

Remy Lebeau
- 555,201
- 31
- 458
- 770
7
Think of the first one as a commented version (one that the compiler will ignore) of the second one.

Konrad Viltersten
- 36,151
- 76
- 250
- 438

Z .
- 12,657
- 1
- 31
- 56