You could load a JavaScript from your user and let them write functions which you call with our CallFunction function. For JavaScript you can define your own functions to be used in the script by calling AddFunction method, so you don't need to know those at compile time and you can load them from a database at runtime. With XojoScript you would have to predefine variables either in context object or in the source code. Our plugin allows you to set/get global properties in the JavaScript memory. You can just pass some JavaScript from your user to the engine and let it execute. So the language is JavaScript and there is built-in functionality for text, array and JSON functions. On the other side we have JavaScriptEngineMBS, which uses Duktape library to provide a ECMAScript engine. There is only one source piece containing all the code, so you can't just predefine some routines outside source. While you can precompile and then run several times, there is no way to store the compiled code anyhow. With context object you can provide your own methods and properties and use them in the scripts. You can use it in your projects, compile code at runtime with a reduced Xojo language and the run it. XojoScript is the scripting engine provided by Xojo and is heavily used in Xojo for IDE scripting. What are differences and benefits for both? Comparing JavaScriptEngineMBS to XojoScript Let's compare a bit XojoScript built-in to Xojo to JavaScriptEngineMBS class in MBS Xojo Tools Plugin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |