[fpc-devel] type discussion

Uberto Barbini uberto at ubiland.net
Thu Jun 2 17:16:04 CEST 2005


On Thursday 02 June 2005 17:07, Marc Weustink wrote:
> From: fpc-devel-bounces at lists.freepascal.org
> [mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of Jamie
> McCracken
> Sent: donderdag 2 juni 2005 16:32
>
> >var strlist : TStringlist;
> >strlist := Tstringlist.create;

If the goal is this, I'd prefear a way to declare objects autocreated:

varauto:
  strlist: TStringList;
begin
  //some stuff
end;

which wil be auto-magically compiled as

var:
  strlist: TStringList;
begin
  strlist := TStringList.Create;
  try
     //some stuff
  finally
    strlist.Free;
  end;
end;

It could be a problem to pass parameters to the constructor.


Bye Uberto




More information about the fpc-devel mailing list