PDA

View Full Version : conditional defines above 'program' keyword in BDS cause EL to not be active


braindead0
19-Oct-2006, 09:47 PM
Hopefully the title explains this well. If I have a DPR file like so:


{$IFNDEF TEST}
we're not going to compile unless you define TEST
{$ENDIF}
program Project2;

uses
ExceptionLog,
Forms,
Unit2 in 'Unit2.pas' {Form2};

{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm2, Form2);
Application.Run;
end.


Even though EL is enabled, the program is using ExceptionLog, etc. When EL tries to init it doesn't find it's resource information (Map file presumably) and does not actually initialize.

If I move the ifndef down below the uses like so:


program Project2;

uses
{$IFNDEF TEST}
YOU MUST BLAH BLAH BLAH, we're not going to compile unless you define TEST' +
{$ENDIF}
ExceptionLog,

It works fine.

The worst thing about this is that one might think that EL is active when in fact it is not, and there's really no indication other than not having ELF files created and the like.

admin
23-Oct-2006, 10:29 AM
Hi,

> Hopefully the title explains this well. If I have a DPR file like so:
>
> [...]

This is not an EurekaLog bug, but only a pascal parser behavior.
Before every compilation EurekaLog parser the Pascal code.

In your code there is a potentially syntax error, so EurekaLog stop to parser
the code.

To solve all try to move your potentially syntax error after the uses clauses.

--
Best regards...

Fabio Dell'Aria.
----------------
http://www.eurekalog.com
Catch every BUG, every time!