The problem is simply that TPoint is a record, not an object, and the
language does not allow comparison operators or records. You'll need to do
comparisons on the fields of the records i.e if (value.x <> fCenter.x) or
value.Y <> fCenter.Y )
and so on...
----- Original Message -----
From: "Chrissy R" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Wednesday, January 31, 2001 11:36 AM
Subject: [DUG]: Help WIth Setting Properties
> Hi, I am stuck and cannot see the problem - can someone help me - PLEASE
>
> The following code (unnecessary procedures etc deleted) will not compile.
I get an
> error on the first line in SetCenter (at the end of the page).
>
> It says "Incompatible Types" but the value and the FCenter are both TPoint
types.
>
> There are only a few more lines in the code and I do not think anything
else impacts
> on this line.
>
> Chrissy.
>
>
> unit unitTreeNode;
>
> interface
>
> uses
> Windows, ComCtrls, Controls, Forms, Classes, Dialogs, Graphics,
ExtCtrls,
> Menus, SysUtils, unitGlobals;
>
> type
> THPTreeNode = class
> private
> FCenter: TPoint;
> function GetCenter: TPoint;
> procedure SetCenter(const Value: TPoint);
> protected
>
> public
> property Center: TPoint read GetCenter write SetCenter;
>
> implementation
>
> uses
> Main;
>
> function THPTreeNode.GetCenter: TPoint;
> begin
> GetCenter := FCenter;
> end;
>
> procedure THPTreeNode.SetCenter(const Value: TPoint);
> begin
> If value <> FCenter then
> FCenter := value;
> end;
>
> end.
>
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"