Simkin Globals


All Simkin objects support certain functions connected with variables, please see the data types page for more information.

Simkin currently comes with a single global object - Interpreter, which represents the Simkin language engine.

This object supports the following field:

tracing (boolean) - set this to true, and a trace of the methods called will be printed out

For example:

Interpreter.tracing=true;
switches tracing on, while this:
Interpreter.tracing=false;
switches tracing off.

Defining Globals

Each instance of the Simkin interpreter has its own set of global variables.

To add an object to the list of global variables, you should use the addGlobalVariable function provided in the Interpreter.

You can also remove an object from the list using the removeGlobalVariable function.

In both cases you need to make a call to the Interpreter in the underlying C++ or Java code.

For example in C++:

MyGlobal * object=new MyGlobalObject();
skInterpeter interp;
interp.addGlobalVariable("MyGlobal",object);
or in Java:
MyGlobal object=new MyGlobalObject();
Interpeter interp=new Interpreter;
interp.addGlobalVariable("MyGlobal",object);