function hello() print("Hello World!"); end
#include "plusscript.hpp" using namespace ps; // Output function void print(char *msg) { printf("%s\n", msg); } int main(int argc, char **argv) { VM::setLoggingOutput("plusscript.log"); // Create VM VM vm; vm.registerBaseFunctions(); // Register external function std::vector<TypeInfo> args; args.push_back(TypeInfo(ETC_UserPtr)); vm.registerFunction("print", (void*)print, TypeInfo(ETC_None), args); // Load script file Module *mod = vm.loadModule("helloworld.ps"); // Call script function vm.getFunction("hello").call(); return 1; }