Hi Folks,
is there a way to find out, if a Unit is in the Uses-Clause?
For discussions sake:
I have a Unit "MainUnit.pas".
In its Uses-clause under Interface i have some other units included (e.g. "Uses classes, sysutils, MyUnitDB, MyOtherUnit").
Now, i'm using inc-files to structure my code, and i want to implement functionality depending on which Unit is in the Uses-clause.
Those inc-files are being included via Directive in my "MainUnit.pas"-File
I was thinking about being smart, and just set a {$DEFINE MyUnitDB} at the top of Unit "MyUnitDB", so i could use in my code in the inc-files
{$IFDEF MyUnitDB}
...use code
{$ENDIF}
But that doesn't seem to work.
Scope of Defines are per File?
I hope i'm clear with what i'm asking/trying to achieve.
Yes, i know i can set defines in Project-Properties, but i'd like to avoid that, because it's a dynamic functionality:
Use a Unit --> Inherit the Define --> Functionality becomes available