First because the compiler should detect it and fodl the code.
Second because it uses less cpu cycles.
:-)
I normally use a local variable to hold teh value with a name that
tells the world what it means. Or
if Option.ItemIndex = 1
then begin
end
else begin
end
>
> Which of the following codeis the most efficient/fastest to execute?
>
> Label1.Enabled := Option.ItemIndex = 1;
> Label2.Enabled := Option.ItemIndex = 1;
>
> or
>
> Label1.Enabled := Option.ItemIndex = 1;
> Label2.Enabled := Label1.Enabled;
>
> Thanks,
> Ross Levis.
>
>
>
Regards
Rohit
======================================================================
CFL - Computer Fanatics Ltd. 21 Barry's Point Road, AKL, New Zealand
PH (649) 489-2280
FX (649) 489-2290
email [EMAIL PROTECTED] or [EMAIL PROTECTED]
======================================================================
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/