質問

I am having trouble using the Inc and Dec procedures in Delphi 2010.

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=Dec

役に立ちましたか?

解決

You can only use inc and dec with variables. You are passing properties instead and they are not variables.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top