Two basic conditional compilation constructs closely resemble Pascal's if statement. The first construct{$IFxxx} ... {$ENDIF}causes the source text between {$IFxxx} and {$ENDIF} to be compiled only if the condition specified in {$IFxxx} is True. If the condition is False, the source text between the two directives is ignored.The second conditional compilation construct:{$IFxxx} ... {$ELSE} ... {$ENDIF}causes either the source text between {$IFxxx} and {$ELSE} or the source text between {$ELSE} and {$ENDIF} to be compiled, depending on the condition specified by the {$IFxxx}.Here are some examples of conditional compilation constructs:{$IFDEF Debug} Writeln('X = ', X); {$ENDIF} {$IFDEF WIN32} P := SmallPointToPoint(Message.Pos); {$ELSE} P := Message.Pos; {$ENDIF}You can nest conditional compilation constructs up to 16 levels deep. For every {$IFxxx}, the corresponding {$ENDIF} must be found within the same source file, which means there must be an equal number of {$IFxxx}'s and {$ENDIF}'s in every source file.
...
{$ENDIF}causes the source text between {$IFxxx} and {$ENDIF} to be compiled only if the condition specified in {$IFxxx} is True. If the condition is False, the source text between the two directives is ignored.The second conditional compilation construct:{$IFxxx}
...
{$ELSE}
...
{$ENDIF}causes either the source text between {$IFxxx} and {$ELSE} or the source text between {$ELSE} and {$ENDIF} to be compiled, depending on the condition specified by the {$IFxxx}.Here are some examples of conditional compilation constructs:{$IFDEF Debug}
Writeln('X = ', X);
{$ENDIF}
{$IFDEF WIN32}
P := SmallPointToPoint(Message.Pos);
{$ELSE}
P := Message.Pos;
{$ENDIF}You can nest conditional compilation constructs up to 16 levels deep. For every {$IFxxx}, the corresponding {$ENDIF} must be found within the same source file, which means there must be an equal number of {$IFxxx}'s and {$ENDIF}'s in every source file.
类似if .... end;
以后你用到了就知道了
具体用法楼上的: cg1120已经写了。主要是在你设定条件判断的时候用吧。