문제

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