Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-03

platform directive

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink

Hi,

Question, does the platform derective onlyt work for properties ? It seems the you may add it to methods and procedures as well, but when accessing them no warning is issued. On FPC 2.0.2 I only get an warning if I access property A.
I couldn't find documentation on this either.

Marc

program platformcheck;
{$mode objfpc}{$H+}
uses
   Classes;
type
   TMyObj = class
   private
     FA: Integer; //platform;
   public
     function GetA: Integer; platform;
     procedure SetA(AValue: Integer); platform;
     property A: Integer read GetA write SetA;  platform;
   end;
function TMyObj.GetA: Integer;
begin
   Result := FA;
end;
procedure TMyObj.SetA(AValue:Integer);
begin
   FA := AValue;
end;
procedure B; platform;
begin
end;
var
   Obj: TMyObj;
begin
   Obj := TMyObj.Create;
   Obj.A := 1;
   Obj.SetA(2);
   Obj.FA := 3;
   WriteLN(Obj.GetA);
   Obj.Free;
   B;
end.

Reply by email