Sign in Join

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

Mailing lists / fpc-devel / 2010-05

var param as property index?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Martin

I don't think the following is intended? (it compiles with trunc).

Note the property index is a var param

   TForm1 = class(TForm)
   private
     function GetFoo(var Index: Integer): Boolean;
   public
     property Foo[var Index: Integer]: Boolean read GetFoo;
   end;
implementation
function TForm1.GetFoo(var Index: Integer): Boolean;
begin
   Result := True;
end;

Reply by email

dmitry boyarintsev
to Martin
Martin wrote 12 lines
I don't think the following is intended? (it compiles with trunc). Note the property index is a var param  TForm1 = class(TForm)  private    function GetFoo(var Index: Integer): Boolean;  public    property Foo[var Index: Integer]: Boolean read GetFoo;  end;

does FPC compile the following, in this case:

var
  f : TForm1;
writeln(f.Foo[0]);

thanks,
dmitry

Reply by email