[fpc-pascal] Pass type as function parameter
dhkblaszyk at gmail.com
Wed Mar 24 11:10:06 CET 2021
Thank you so much Michael!
On Wed, Mar 24, 2021 at 11:05 AM Michael Van Canneyt <michael at freepascal.org>
> On Wed, 24 Mar 2021, Darius Blaszyk via fpc-pascal wrote:
> > Hi,
> > Would it be possible in FPC to pass a type of a variable as a parameter
> > a function?
> > e.g.
> > MyFunction(integer);
> > I have legacy C code that does this via a macro. Hopefully, it can be
> > so I do not need to change the existing code too badly.
> This is not possible as such.
> What you can do is use generics
> or use typeinfo:
> Which of the 2 you need to use depends on the code of course.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal