[fpc-devel]Some compiler problems?

Aleksey V. Vaneev picoder at sbis.komi.ru
Wed Mar 21 16:29:09 CET 2001


Hello,

>   But I've found a routine that causes the error. It is a nested
>   procedure in a class method and when I do something s := '$' +
>   mystr; where s is an AnsiString variable, it reports error I'm
>   talking about.

I've found why this bug is occuring..

Consider, please, this example:

----
procedure TObj.Proc1 (p1, p2: DWord);
var
  sss: AnsiString;

  procedure checkParam (p: DWord); inline;
  begin
    if (p > 20) then
      halt;
  end;

  procedure setupParams;
  var
     s: AnsiString;
     
  begin
    checkParam (p1);

    s := '$' + sss;
  end;
  
begin
  sss := '12345';

  setupParams;
end;
----

Problem was solved by removing inline; statement. This example is not
exactly what I have, but very similar.

Best regards,
 Aleksey                          mailto:picoder at sbis.komi.ru






More information about the fpc-devel mailing list