Here is my code idea from a previous thread about method pointers, which you might be happy to use for this purpose:
From here: http://www.blitzbasic.com/Community/posts.php?topic=65492#731769
"Since every instance of a type has the same methods, which are taken from the type definition itself, and there is no `custom method code` for each instance of the type, you might as well let functions within the type definition itself be the location of code. In that sense there isn't really any point using Methods at all. But then the only thing you're left with wanting to do is to to be able to access the instance's variables as if they are global within the instance and available across all the function calls within the instance. So then why not have some kind of lookup table of function pointers within the type, which would then be in the instance, which bundles together the `Self` as a parameter passed to the actual functions with code in them that are stored in the type definition ???? ie abstractify the function calls and insert scope changes before the real functions are called? Would that be sufficient to allow you to switch and change which functions are called from each instance, given that each instance now has its own indirect jump table with function pointers local to it?"
Does that work for you?
Type MyType Field FieldA:Int Field FieldB:Float Field RedirectPrintIt(Value:Int,Who:MyType) Method New() RedirectPrintIt=ActuallyPrintIt 'default function End Function Method PrintIt(Value:Int) RedirectPrintIt(Value Var,Self) End Function Function ActuallyPrintIt(What:Int Var,Who:MyType Var) Print "Wow "+What Print Who.FieldA Print Who.FieldB End Function Function ActuallyDoSomethingElse(What:Int Var,Who:MyType Var) Print "Redirected! "+What Print Who.FieldA Print Who.FieldB End Function End Type Local Instance:MyType=New MyType Instance.FieldA=10 Instance.FieldB=12.5 Instance.PrintIt(15) Instance.RedirectPrintIt=MyType.ActuallyDoSomethingElse Instance.PrintIt(15)
From here: http://www.blitzbasic.com/Community/posts.php?topic=65492#731769
"Since every instance of a type has the same methods, which are taken from the type definition itself, and there is no `custom method code` for each instance of the type, you might as well let functions within the type definition itself be the location of code. In that sense there isn't really any point using Methods at all. But then the only thing you're left with wanting to do is to to be able to access the instance's variables as if they are global within the instance and available across all the function calls within the instance. So then why not have some kind of lookup table of function pointers within the type, which would then be in the instance, which bundles together the `Self` as a parameter passed to the actual functions with code in them that are stored in the type definition ???? ie abstractify the function calls and insert scope changes before the real functions are called? Would that be sufficient to allow you to switch and change which functions are called from each instance, given that each instance now has its own indirect jump table with function pointers local to it?"
Does that work for you?