> Which of the following code is the most efficient/fastest to execute?

The following code is faster than the both of them:

var
  temp: Boolean;
begin
  temp := Option.ItemIndex = 1;
  Label1.Enabled := temp;
  Label2.Enabled := temp;

Of course, the screen is going to update asynchronously, so that regardless
of which method you use, the user will not be able to notice the difference!

----- Original Message -----
From: Ross Levis
To: Multiple recipients of list delphi
Sent: Thursday, October 30, 2003 9:23 PM
Subject: [DUG]: Just wondering...


Which of the following code is 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.
---------------------------------------------------------------------------
    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/

Reply via email to