Re: {$ELSEIF} not working in Delphi 2006 ?
- From: "Skybuck Flying" <spam@xxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 12:25:43 +0200
Ok,
I think I have found a solution...
By using {$IF} and DEFINED it's now working.
I still don't know why the second example is not working.
Also these different compiler directives $IF and $IFDEF and $IFEND and
$DEFIF is quite confusing !
Using $IFDEF also doesn't work and $ELSEIFDEF does not exist etc... just
weird !
program Test;
{$APPTYPE CONSOLE}
uses
SysUtils;
{$DEFINE C}
begin
// this works:
{$IF DEFINED(A)}
writeln('A');
{$ELSEIF DEFINED(B)}
writeln('B');
{$ELSEIF DEFINED(C)}
writeln('C');
{$IFEND}
// this does not work:
{$IF A}
writeln('A');
{$ELSEIF B}
writeln('B');
{$ELSEIF C}
writeln('C');
{$IFEND}
readln;
end.
Bye,
Skybuck.
.
- References:
- {$ELSEIF} not working in Delphi 2006 ?
- From: Skybuck Flying
- {$ELSEIF} not working in Delphi 2006 ?
- Prev by Date: {$ELSEIF} not working in Delphi 2006 ?
- Next by Date: Detecting WIN32 or .NET example in a compiler directive
- Previous by thread: {$ELSEIF} not working in Delphi 2006 ?
- Next by thread: Re: {$ELSEIF} not working in Delphi 2006 ?
- Index(es):