sq_pushroottable(v); sq_pushstring(v, "print", -1); sq_get(v, -2); //get the function from the root table sq_pushroottable(v); //’this’ (function environment object) sq_pushstring(v, "hello world", -1); if(SQ_FAILED(sq_call(v, 2, 0))) assert(0); sq_pop(v,2); //pops the roottable and the function
the sq_pushstring(v, "hello world", -1); this should be done by vm not? In the script I have print("hello") and the output is "hello world" the string I pushed onto the stack. Argg :)