[fpc-pascal] How to use a static method as procedure variable?

silvioprog silvioprog at gmail.com
Tue Jun 30 21:45:55 CEST 2015


On Tue, Jun 30, 2015 at 4:22 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>
wrote:

> On 30/06/15 20:54, silvioprog wrote:
> > The code above compiles fine in Delphi (tested in XE 7), but in FPC I
> > got the following compiling error:
> >
> > Unit1.pas(46,14) Error: Incompatible types: got "<class method type of
> > procedure({Open} Array Of Byte;out AnsiString) of object;Register>"
> > expected "<procedure variable type of procedure({Open} Array Of Byte;out
> > AnsiString);Register>".
> >
> > Is this a bug or I need to enable some switch?
>
> FPC currently only supports that in Delphi mode:
> http://bugs.freepascal.org/view.php?id=27414
>
> Jonas


Hm... my unit (+- 500 lines) is implemented in mode objfpc, so if I change
it to mode delphi I'll get several sintax erros.

It seems that the only way to fix that is using an usual procedure instead
of a static method. =/

Plans to fix it for mode objfpc or it won't be solved?

Thanks!

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150630/2d3e7e48/attachment.html>


More information about the fpc-pascal mailing list