delphi2010中的错误行为/错误“提取方法”
发布时间:2020-12-15 04:20:27 所属栏目:大数据 来源:网络整理
导读:当我尝试在if语句中提取一个方法时,我正面临这个问题.我无法找到任何报告的错误. procedure TForm1.BitBtn3Click(Sender: TObject);var x: integer; b: boolean;begin if true then x := 8 //********************** i try to extract this line else x := 6
当我尝试在if语句中提取一个方法时,我正面临这个问题.我无法找到任何报告的错误.
procedure TForm1.BitBtn3Click(Sender: TObject); var x: integer; b: boolean; begin if true then x := 8 //********************** i try to extract this line else x := 6; showmessage(inttostr(x)); end; 我得到的结果是: procedure TForm1.BitBtn3Click(Sender: TObject); var x: integer; b: boolean; begin if true then newMethode else x := 6; showmessage(inttostr(x)); end; 而新的Methode是: procedure TForm1.newMethode; var x: Integer; begin x := 8; end; 任何人都可以检查Delphi XE上的行为是什么?有谁知道是否有报道? 解决方法
这是“提取方法”重构中的一个错误.
作为替代方案,您可能希望使用ModelMaker Code Explorer重构工具中的“提取方法”重构. 99欧元,这是一个relatively cheap工具,从Delphi 5开始工作,而recent 9.0.5 updates大大改进了他们的Extract Method重构,以至于我已经很长时间没有使用Delphi内置的了. 两大好处: >它启动方法编辑器对话框,您可以在其中更改和重新排序参数,然后将这些参数反映在提取和调用的代码中 此外,它还在代码中放置书签(编号为7,8和9),以便在提取的代码和呼叫站点之间轻松导航. 强烈推荐. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |