Structures

Previous  Next

 

mb_interpreter_t

 

There are 2 data structures/types that the MyBASIC2 uses that are of importance to the developer implementing scripts in a host applications.  When opening/creating an interpreter, MyBASIC2 will create the  mb_interpreter_t structure and this will then be passed in each callback to the host application.  This strucure is defined in MyBASIC2.h

 

mb_value_t

 

Data values passed to function callbacks are passed as mb_value_t.  This is similar to Visual Basics Variant data type.  A variant strcuture contains the type of the data, the variable name (if any) and the actual value.  It is defined in MyBASIC2.h and is being passed to and from any function callback by using mb_pop_value or mb_push_value.  Other pop/push functions are merely an interface function to make it easier for the developer.  They all call mb_pop_value or mb_push_value to make the actual data interchange.