#include <acdk/cfgscript/Script.h>
::acdk::cfgscript::RScript script = new ::acdk::cfgscript::Script("<mem>");
::acdk::cfgscript::RProps props = new ::acdk::cfgscript::Props();
// pass variable to the interpreter
props->setObjectVal("sb", new StringBuffer("CfgScript"));
RString code =
"String retString = \"Hallo\" + sb.toString();\n"
"acdk.lang.System.out.println(retString);\n"
;
// ScriptReadWriteParent allows the interpreter to write into
// the given props
script->eval(code, &props, ::acdk::cfgscript::ScriptReadWriteParent);
// get the resulting string
RString retString = props->getStringVal("retString");
|