Is there any way to invoke a method passing parameters through rtti?
Best regards

Mailing lists / fpc-pascal / 2016-05
8 messages · 4 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Is there any way to invoke a method passing parameters through rtti?
Best regards
Mazo Winst wroteIs there any way to invoke a method passing parameters through rtti?
Yes, it should be possible. Take a look at the FPCUnit (unit testing framework) included with FPC. The testing framework invokes methods and passes parameters around.
Regards,
Graeme
Is there any way to invoke a method passing parameters through rtti? Best regards
"Mazo Winst" wroteIs there any way to invoke a method passing parameters through rtti?
As long as you know the signature of the method you can cast the pointer to the method to an approbiate method variable and call that. For dynamic calls you'll need to wait for Invoke() support which is on the ToDo list, but there's no ETA yet.
Regards,
Sven
to the method to an approbiate method variable and call that. For dynamic calls you'll need to wait for Invoke() support which is on the ToDo list, but there's no ETA yet.
In my use case,the name of the method are regards
Yes, it should be possible. Take a look at the FPCUnit (unit testing framework) included…
Em segunda-feira, 9 de maio de 2016, Graeme Geldenhuys <
Does the framework knows the method signature at compile time?
I will take a look. Thanks for the tip.
Best regards
Em segunda-feira, 9 de maio de 2016, Sven Barth to the method to an approbiate method…
pointer to the method to an approbiate method variable and call that. For dynamic calls you'll need to wait for Invoke() support which is on the ToDo list, but there's no ETA yet.
> In my use case,the name of the method are name is not the problem. The signature is. As long as you know the
signature at compile time you won't have any trouble currently. Everything else you'll need to do yourself currently.
Regards,
Sven
As long as you know the signature of the method you can cast the pointer to the method to…
Will this result in a new kind of Pascal Script support ? (In the German Forum there recently had been discussions on Pascal script not working decently on 64 Bit archs.)
-Michael
to the method to an approbiate method variable and call that. For dynamic calls you'll need to wait for Invoke() support which is on the ToDo list, but there's no ETA yet.
> Will this result in a new kind of Pascal Script support ? (In the German
Forum there recently had been discussions on Pascal script not working decently on 64 Bit archs.)
Don't know as I'm not using PascalScript, but potentially it could be.
Regards,
Sven