Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/IDE/Project Management/Project Source    [ Add a report in this area ]  
Report #:  35672   Status: Closed
Complier Directive Removal When Adding Units
Project:  Delphi Build #:  10.0.2445.40105
Version:    10.0 Submitted By:   Lance Rasmussen
Report Type:  Basic functionality failure Date Reported:  10/24/2006 5:30:38 PM
Severity:    Serious / Highly visible problem Last Updated: 11/25/2012 5:14:21 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Duplicate  Resolved in Build: : XE3
Duplicate of:  6294
Voting and Rating
Overall Rating: (2 Total Ratings)
5.00 out of 5
Total Votes: 5
Description
I am using a project which has units/forms that may or may not be included in the project based on compiler directives.

In the project source I have placed directives encompasing the units I want to include into the project.

When adding an additional unit into the project, the compiler directives are removed.
Steps to Reproduce:
1. Create a project and add several existing units to the project.
2. Place a compiler directive around one or more units.
3. Save the project.
4. Add an existing unit.

The compiler directives will be removed from the project source.

Example:

MainUnit in 'mainunit.pas',
{$ifndef YYYY}
  unit1 'unit1.pas',
  unit2 'unit2.pas',
{$endif}
Workarounds
None
Attachment
None
Comments

Florent Ouchet at 10/25/2006 1:40:36 AM -
You could include these units from an other unit. (assuming they are located in a directory listed in the project "Browse folders" list).
The project manager doesn't handle conditional defines and your changes will be discarded on the next change.
Assuming these conditions could be configured in the project manager, the conditional defines may be so complicated (IFDEF IF IFNDEF IFOPT ELSE...) that the GUI would be awful.

Server Response from: ETNACODE01