How will the Delphi compiler compiles the following code ;
uses a_big_unit;
procedure TForm1.Button1Click(Sender: TObject);
var
acompont : T_a_big_component ;
begin
if (true = false ) then // or if false then
begin
bc := Tbig_component.create(self)
end;
in this code true = false will never happen so component acompont will never created .
when delphi is compiling in optimized mode will these unused units and code are omitted
AND WHEN using units
in delphi 7 , even if you just uses XPMan unit; (without using any components it has(TXPManifest1)) , still the unit is used and every components are shown with theme ;
and some said Delphi will omit units if it is not needed ;
So how Delphi identifies whether a unit has an impact on the unit it calls or not
if false then? - Andreas Rejbrandasm int 3;end;) before the if statement, run it, and then check if the if statement is missing? - CodesInChaosfalse=true,true=falseandfalseare equivalent - CodesInChaos