[fpc-pascal] Delphi mode syntax error

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Jan 19 11:27:28 CET 2010


On 19 Jan 2010, at 11:14, Roland Turcan wrote:

> I use Delphi style of programing in Lazarus to keep a compatibility
> with Kylix and therefore I want to get this code which is valid of
> Freepascal's ObjectPascal, but in {$MODE Delphi} it doesn't accept
> calling of "MyItems[index]" and writes "Array type required".
>
> How to adapt this code to be valid for Delphi mode.

Since you posted an incomplete sample, I can only guess, but...

>  ShowMessage (IntToStr (MyItems[0]));

I think this should work:
   ShowMessage (IntToStr (MyItems[0]()));

Please also file a bug report with a compilable example (which does  
not depend on Lazarus) that demonstrates the problem, although some  
things have been fixed recently regarding procvars in Delphi mode and  
it may already work with svn trunk.


Jonas



More information about the fpc-pascal mailing list