type
TObject = class
private
FValue: ^Integer;
procedure SetValue(const Value: Integer);
function GetValue: Integer;
public
property Value: Integer read GetValue write SetValue;
constructor Create;
destructor Destroy;
end;
{ TObject }
constructor TObject.Create;
begin
New(FValue);
end;
destructor TObject.Destroy;
begin
FValue := nil;
end;
function TObject.GetValue: Integer;
begin
GetValue := FValue^;
end;
procedure TObject.SetValue(const Value: Integer);
begin
FValue^ := Value;
end;
var
Item: TObject;
begin
Item := TObject.Create;
Item.Value := 5;
Write(Item.Value);
ReadLn;
end.