Errr.... to a point. BTW, in the Method declaration for dofunc2(msg:String), did you mean for the line before the End Method to read "Return locfunc2(msg)" instead of just "locfunc2(msg)"?
Let me see if I have this straight. You declare fields of your type which act as byte pointers. You then associate each method with that pointer (I'm a little unclear on this. What purpose do the local variables like "locfun1:float()" serve? And where are they returned to?). Then after creating your instance of the type (tester) you point the field pointer in the type to each function (I assume that in "tester.func1=func1" the second func1 is the function defined outside the method ... I'm getting confused by the name overloading). Is that the basic process?
Note that what I want to do is create a method in a type that has no definition, then, in the main body of the program, assign that method to be a function that I have local to that main body. I think that is what you are doing, but I'm still fuzzy on it.
My main idea is this, I would like to code a type to hold mouse events in zones. This type would hold open references to the mouse being right-clicked, left-clicked, and so on. I can then use this file on many different programs, simply by making a function for each possible mouse state and connecting it to the open method in the type. That way in one program a right-click could maximize, while in another the right-click could select. All I would have to do is refer the type's method "right_click" to the function in each different program that it should activate. I think I see how to do it with your code, but the actual methods in your code that you overwrite have me confused.
Anyway, off to experiment with your code! Thatnks for the help!!
Let me see if I have this straight. You declare fields of your type which act as byte pointers. You then associate each method with that pointer (I'm a little unclear on this. What purpose do the local variables like "locfun1:float()" serve? And where are they returned to?). Then after creating your instance of the type (tester) you point the field pointer in the type to each function (I assume that in "tester.func1=func1" the second func1 is the function defined outside the method ... I'm getting confused by the name overloading). Is that the basic process?
Note that what I want to do is create a method in a type that has no definition, then, in the main body of the program, assign that method to be a function that I have local to that main body. I think that is what you are doing, but I'm still fuzzy on it.
My main idea is this, I would like to code a type to hold mouse events in zones. This type would hold open references to the mouse being right-clicked, left-clicked, and so on. I can then use this file on many different programs, simply by making a function for each possible mouse state and connecting it to the open method in the type. That way in one program a right-click could maximize, while in another the right-click could select. All I would have to do is refer the type's method "right_click" to the function in each different program that it should activate. I think I see how to do it with your code, but the actual methods in your code that you overwrite have me confused.
Anyway, off to experiment with your code! Thatnks for the help!!