[英]Delphi inc and dec not compiling?
I am having trouble using the Inc and Dec procedures in Delphi 2010. 我在使用Delphi 2010中的Inc和Dec程序时遇到问题。
Here's a snippet of my code: 这是我的代码片段:
if NOT(frmMain.Height = 0) then
begin
Dec(frmMain.Height, 2);
Inc(frmMain.Top);
end;
And I get a: 我得到一个:
[DCC Error] frmMain_U.pas(44): E2064 Left side cannot be assigned to
Any ideas? 有任何想法吗? I have a feeling I might be missing something stupid here...
我有一种感觉,我可能会在这里错过一些愚蠢的东西......
EDIT: Read up on procedures here: 编辑:阅读这里的程序:
http://www.delphibasics.co.uk/RTL.asp?Name=Inc http://www.delphibasics.co.uk/RTL.asp?Name=Inc
http://www.delphibasics.co.uk/RTL.asp?Name=Dec http://www.delphibasics.co.uk/RTL.asp?Name=Dec
You can only use inc and dec with variables. 您只能将inc和dec与变量一起使用。 You are passing properties instead and they are not variables.
您正在传递属性而它们不是变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.