MCPcopy Create free account
hub / github.com/anjo76/angelscript / ExecString

Function ExecString

sdk/samples/console/source/main.cpp:183–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void ExecString(asIScriptEngine *engine, string &arg)
184{
185 string script;
186
187 // Wrap the expression in with a call to _grab, which allow us to print the resulting value
188 script = "_grab(" + arg + ")";
189
190 // TODO: Add a time out to the script, so that never ending scripts doesn't freeze the application
191
192 int r = ExecuteString(engine, script.c_str(), engine->GetModule("console"));
193 if( r < 0 )
194 cout << "Invalid script statement. " << endl;
195 else if( r == asEXECUTION_EXCEPTION )
196 cout << "A script exception was raised." << endl;
197}
198
199void AddVariable(asIScriptEngine *engine, string &arg)
200{

Callers 1

mainFunction · 0.85

Calls 2

ExecuteStringFunction · 0.85
GetModuleMethod · 0.45

Tested by

no test coverage detected