Skip to content

Basic Usage

Rohan Singh edited this page Feb 24, 2015 · 3 revisions

In order to run Mond scripts you need to create a new state.

var state = new MondState();

Scripts can then be run by using state.Run.

var result = state.Run("return 1 + 1;");

All values can be converted to a string using its Serialize function.

Console.WriteLine(result.Serialize());

Globals can be accessed with the state's indexer.

state["a"] = 10;

state.Run("global.b = global.a * global.a;");

Console.WriteLine(state["b"].Serialize());