Deephi compilation optimization caused by dead circulation

xiaoxiao2021-03-05  21

Please see the following code:

Procedure TForm1.Button1Click (Sender: TOBJECT); VAR STRCOLOR: STRING; I, R, G, B, P: Integer; strlist: tstringlist; begin strcolor: = medt.text '-'; strlist: = tstringlist.create; Try for r: = 0 to 2 do // Change the variable R to i normal begin // showMessage (INTTOSTR (R)); plus this sentence is also normal to read the R value in the cyclic body P: = POS ('-' , strcolor; strlist.add (Copy (strcolor, 0, p-1)); delete (strcolor, 1, p); end;

R: = start (Strlist [0]); g: = start (strlist [1]); b: = start (strlist [2]); finally strlist.free;

Self.color: = Tcolor (RGB (R, G, B));

Edtcolor.Text: = '$' INTTOHEX (Tcolor (RGB (R, G, B)), 8);

EDTCOLOR.SETFOCUS; END;

Because there is no R variable in the cycle statement, the use of R is used outside the cycle. Compiler optimization caused errors? In Delphi, the cycle factor cannot be changed in the cycle.

The following is posted on the anti-compiled assembly code:

转载请注明原文地址:https://www.9cbs.com/read-38162.html

New Post(0)