Ok, I just moved that declaration to under the var section of the unit, and
it all works, so I'm thinking I can't do conditionals in a class
declaration?  I could understand the problem if it was a published property
being stored in a dfm but there not...   Is this a bug in Delphi or is this
behaviour documented?

> Hiya, I've just changed some of my code to use IFDEF's to 
> allow for some conditional stuff, I have in my 
> TformUnitEditor's delcaration:
> 
>   ....
>   private
> {$IFDEF USE_ADO}
>     qFields: TADOQuery;
>     qUnits: TADOQuery;
> {$ELSE}
>     qFields: TTable;
>     qUnits: TTable;
> {$ENDIF}
>   ....
> 
> Now, when I call TformUnitEditor.Create my app crashes with a 
> "invalid property value" error.  I put a breakpoint in 
> TformUnitEditor's OnCreate which has more IFDEF stuff to 
> setup the components but Delphi's not even getting this far.  
> Any ideas?
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to