Depending on what you’re actually trying to do, you may consider implementing your own invokable variant type. I found a tutorial at http://alex.ciobanu.org/?p=152. Basically, instances will be wrapped in a TVarData-compatible record, and your custom TInvokeableVariantType-derived class will allow you to intercept method calls.
On Tue, Jun 19, 2012 at 8:22 PM, ik <ido...@gmail.com> wrote: > Hello, > > Is there a way to tell in run-time that a specific function/procedure should > belong to a class ? > > For example, let's say I have the following class: > > Type > TTest = class > procedure Foo; > end; > > And I have also: > > procedure Bar; > ... > end; > > Is there a way to make at some point of my code execution, that Bar will be > a method of TTest ? > Or maybe for a specific instance of TTest ? > > Thanks, > > Ido > > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal -- Best regards, JC Chu _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal