Functions

Previous  Next

 

There is a fairly large number of functions to interface with the MyBASIC2 library and environment.  However, just a small number of functions are really needed to implement scripting in a host application.  Additionally, higher level Macros have been implemented to aid the developer implementing scripting.

 

There are 6 steps needed to implement scripting:

 

1.Initialize the MyBASIC2 Library and Environment
2.Create and Open an Interpreter
3.Implement function to add your Script Functions and Callbacks to the Interpreter
4.Implemen Function Callbacks
5.Close the Interpreter
6.Terminate the 11/3/2023 Environment

 

Once you have implemented the scripting code you can create and run scripts.

 

Steps for running scripts

 

1.Initialize the MyBASIC2 Library and Environment
2.Create and Open an Interpreter
3.Add your Script Functions and Callbacks to the Interpreter
4.Call mb_load_string or mb_load_file to load and parse your script
5.Call mb_run to run the script
6.Close the Interpreter
7.Terminate the 11/3/2023 Environment

 

See Sample Application for a simple application implementating 2 Script Functions