I’m making some test and evaluating Xojo for my project.
I need to implement some scripting features, and made some tests.
I understood that I can expose code written in Xojo via “context” (and xojoscript see, for example, methods as global methods).
Is there any way (any trick) to expose to xojoscript an entire object defined in xojo (not instance, but class)?
For example, in xojo I create the class Calculator:
class Calculator
function add(argNum1 as integer, argNum2 as integer) as integer
return argNum1 + argNum2
end function
end class
I want to instantiate and use that class in xojoscript:
There is another option… you can define a Class in xojoscript, where it’s methods call back into the context. Basically you mirror the class completely in xojoscript and then you can “instantiate” one on the fly.
Yes, I was thinking to that solution, but does not solve my problem. In fact, I wanted to avoid to method per method, some special classes I’m creating for the script.
If I could map entire classes, in a future, if I will add a new method, if I have automatically that new method in script also. Instead, I’m obliged to map everything by hand.