Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 12 total
Thread DEFINE symbol remains effective when removed
Wed, Nov 4 2015 2:52 AMPermanent Link

Michael Dreher

After compiling and executing (in the IDE) an application with a defined symbol, the symbol remains effective when it's commented out or removed from the code. Example:
---------------------------
{$DEFINE DEFINE_SOMETHING} // (0)

procedure foobar;
begin         
 {$IFDEF DEFINE_SOMETHING}
 LogOutput('within the define section...'); // (1)
 {$ENDIF}
end;

initialization  
 foobar;
end.
---------------------------
(1) is logged in the message window as expected. Now delete line (0), recompile and execute. (1) still is logged. The symbol remains effective until the a restart of the IDE.

Michael Dreher
Wed, Nov 4 2015 4:39 AMPermanent Link

Matthew Jones

Michael Dreher wrote:

>  The symbol remains effective until the a restart of the IDE.

I presume that this is the key. I expect the list of defines is not
cleared at the start of compilation.

More important, how come no one mentioned this new facility to me? 8-)
What is really needed is a project option to be able to set at least
one define, so that the code can be compiled appropriately. Command
line support too.


--

Matthew Jones
Wed, Nov 4 2015 2:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< After compiling and executing (in the IDE) an application with a defined symbol, the symbol remains effective when it's commented out or removed from the code. >>

Thanks, this is now fixed for 2.02 B5, which I'll be uploading this evening.

Tim Young
Elevate Software
www.elevatesoft.com
Sun, Jan 24 2016 11:39 AMPermanent Link

Gruetzmacher

was this fixed?
as with 2.04 it seems even
{$IFDEF DESIGN}
is not working ...  


Tim Young [Elevate Software] wrote:

Michael,

<< After compiling and executing (in the IDE) an application with a defined symbol, the symbol remains effective when it's commented out or removed from the code. >>

Thanks, this is now fixed for 2.02 B5, which I'll be uploading this evening.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jan 25 2016 5:37 AMPermanent Link

Michael Dreher

Gruetzmacher wrote:

  ///  was this fixed?
  ///  as with 2.04 it seems even
  ///  {$IFDEF DESIGN}
  ///  is not working ...  

I tracked this; the described error (defined symbol remaining effective once compiled)  was fixed the next release and it still works in 2.04 Build 1.
Can you provide a more complete code example of the problem?

Michael Dreher
Mon, Jan 25 2016 8:42 AMPermanent Link

Gruetzmacher

hello,
something like

{$IFDEF DESIGN}
LogOutput('Hallo');
{$ENDIF}

does never get executed when running my project in the ide ...

Michael Dreher wrote:

Gruetzmacher wrote:

  ///  was this fixed?
  ///  as with 2.04 it seems even
  ///  {$IFDEF DESIGN}
  ///  is not working ...  

I tracked this; the described error (defined symbol remaining effective once compiled)  was fixed the next release and it still works in 2.04 Build 1.
Can you provide a more complete code example of the problem?

Michael Dreher
Mon, Jan 25 2016 9:45 AMPermanent Link

Raul

Team Elevate Team Elevate

On 1/25/2016 8:42 AM, Gruetzmacher wrote:
> something like
> {$IFDEF DESIGN}
> LogOutput('Hallo');
> {$ENDIF}
>
> does never get executed when running my project in the ide ...

I'm not sure DESIGN define is for actually running at app in IDE - i
think it is for rendering it in IDE for the form designer (WYSIWYG aspects).

When you run the app in DIE you would need all the code to run
"normally" as it would do in browser (if you look at framework then
DESIGN turns off lot of events and such).

Raul
Mon, Jan 25 2016 9:53 AMPermanent Link

Raul

Team Elevate Team Elevate

On 11/4/2015 2:52 AM, Michael Dreher wrote:
> After compiling and executing (in the IDE) an application with a defined symbol, the symbol remains effective when it's commented out or removed from the code. Example:
> ---------------------------
> {$DEFINE DEFINE_SOMETHING} // (0)
>
> procedure foobar;
> begin
>    {$IFDEF DEFINE_SOMETHING}
>    LogOutput('within the define section...'); // (1)
>    {$ENDIF}
> end;
>
> initialization
>    foobar;
> end.
> ---------------------------
> (1) is logged in the message window as expected. Now delete line (0), recompile and execute. (1) still is logged. The symbol remains effective until the a restart of the IDE.

Not able to duplicate it here - 2.04 Build 1 using built-in web server.

Once i commented out the "{$DEFINE... ", saved, recompiled and ran the
project nothing was logged so works as expected.

Raul

Mon, Jan 25 2016 10:45 AMPermanent Link

Gruetzmacher

thank you Raul,
probably it was my wrong expectations. in delphi you have an ide compiler-symbol - that's what i thought 'DESIGN' would be

Raul wrote:

On 11/4/2015 2:52 AM, Michael Dreher wrote:
> After compiling and executing (in the IDE) an application with a defined symbol, the symbol remains effective when it's commented out or removed from the code. Example:
> ---------------------------
> {$DEFINE DEFINE_SOMETHING} // (0)
>
> procedure foobar;
> begin
>    {$IFDEF DEFINE_SOMETHING}
>    LogOutput('within the define section...'); // (1)
>    {$ENDIF}
> end;
>
> initialization
>    foobar;
> end.
> ---------------------------
> (1) is logged in the message window as expected. Now delete line (0), recompile and execute. (1) still is logged. The symbol remains effective until the a restart of the IDE.

Not able to duplicate it here - 2.04 Build 1 using built-in web server.

Once i commented out the "{$DEFINE... ", saved, recompiled and ran the
project nothing was logged so works as expected.

Raul
Mon, Jan 25 2016 11:02 AMPermanent Link

Raul

Team Elevate Team Elevate

On 1/25/2016 10:45 AM, Gruetzmacher wrote:
> thank you Raul,
> probably it was my wrong expectations. in delphi you have an ide compiler-symbol - that's what i thought 'DESIGN' would be

One can always ask Tim to include a future enhancement (if not already
on the list) to allow for development time custom defines.

Easiest would be to just ignore those during deploy step but more
flexible would be "debug" vs "release" compile config option where you
can configure the defines.

Raul
Page 1 of 2Next Page »
Jump to Page:  1 2
Image