On Tue, 5 Mar 2013, Howard Page-Clark wrote:

On 04/03/13 10:33, José Mejuto wrote:

The code that makes me wonder something is wrong is this one:

-----------------------------------
{$mode objfpc}
{$h+}

procedure TheB(var aTheA: string);

begin
   aTheA:=aTheA+'A';
end;

function TheA(): string;

begin
   //Result:='';
   TheB(Result);
end;

Var
   C : String;

begin
   C:='B';
   C:=TheA;
   C:=TheA;
   Writeln('= "',C,'"');
end.

For me (win32, FPC 2.6.2) the output is identical (= "A") whether or not Result in TheA() is initialised manually or not. Perhaps 2.7.1 has a regression here if it differs for you?

It is not a regression. 2.7.1 has the Delphi compatible behaviour.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to