Board index » delphi » Delphi 3 adding units to my uses?

Delphi 3 adding units to my uses?

        I have a project that I would like to build both 16-bit
        (Delphi 1.02) and 32-bit (Delphi 3) versions of.  I have
        been able to build both using the same source files in
        different directories, using $IFDEFs where necessary.
        The problem is that Delphi 3 wants to add a unit where
        it shouldn't.

        I'm using the Crystal Reports 6.0 component as my report
        generator.  In the report.pas file, I am using two 'uses'
        statements and the conditional compilation directives:

        {$IFDEF DELPHI1}
        uses unit1, unit2,...,ucrpe;
        {$ELSE}
        uses unit1, unit2,...,ucrpe32;
        {$ENDIF}

        The 'ucrpe' and 'ucrpe32' are the 16- and 32-bit units for
        the Crystal Reports component.  The strange thing is, when
        I compile this file using Delphi 3, it automatically appends
        'ucrpe32' to the first 'uses' statement, the one it's not even
        supposed to use.  Anybody know how to fix this behavior?

        Thanks in advance,

        Tim

--
Tim Dietz
Digital Equipment Corporation
t...@rbc.dec.com

 

Re:Delphi 3 adding units to my uses?


It seems as if  delphi3 is using the first uses clause instead of the
second, I'd make sure that in delphi3 the DELPHI1 is not defined which
should lead to delphi3 taking the second uses clause, what your idea is.

You can test this by adding something like
{$IFDEF DELPHI1}
Showmessage('Delphi 1 found');
{$ELSE}
Showmessage('Delphi 3 found');
{&ENDIF}

somewhere in a function/procedure and call that function/procedure

HTH

  Roel

Quote
Tim Dietz <t...@rbcdec.com> wrote:

:       I have a project that I would like to build both 16-bit
:       (Delphi 1.02) and 32-bit (Delphi 3) versions of.  I have
:       been able to build both using the same source files in
:       different directories, using $IFDEFs where necessary.
:       The problem is that Delphi 3 wants to add a unit where
:       it shouldn't.
:      
:       I'm using the Crystal Reports 6.0 component as my report
:       generator.  In the report.pas file, I am using two 'uses'
:       statements and the conditional compilation directives:

:       {$IFDEF DELPHI1}
:       uses unit1, unit2,...,ucrpe;
:       {$ELSE}
:       uses unit1, unit2,...,ucrpe32;
:       {$ENDIF}

:       The 'ucrpe' and 'ucrpe32' are the 16- and 32-bit units for
:       the Crystal Reports component.  The strange thing is, when
:       I compile this file using Delphi 3, it automatically appends
:       'ucrpe32' to the first 'uses' statement, the one it's not even
:       supposed to use.  Anybody know how to fix this behavior?

:      
:       Thanks in advance,

:       Tim

: --
: Tim Dietz
: Digital Equipment Corporation
: t...@rbc.dec.com

Re:Delphi 3 adding units to my uses?


Quote
Tim Dietz wrote...

| I have a project that I would like to build both 16-bit
| (Delphi 1.02) and 32-bit (Delphi 3) versions of.  I have
| been able to build both using the same source files in
| different directories, using $IFDEFs where necessary.
| The problem is that Delphi 3 wants to add a unit where
| it shouldn't.

[snip]

|

DELPHI1 is - afaik - not a predefined conditional parameter, so
the compiler will never take the ELSE branch;

try:
{$IFNDEF WIN32}  <<== predefined in D2/3, not in D1
| uses unit1, unit2,...,ucrpe;
| {$ELSE}
| uses unit1, unit2,...,ucrpe32;
| {$ENDIF}

Regards,
Dirk Claessens
______________________________________________
Home   : <dirk.claess...@village.uunet.be>
Office : <dirk.claessens...@belgium.agfa.com>
Nothing will come of nothing.
Dare mighty things. (William Shakespeare)
______________________________________________

Other Threads