| 181 | } |
| 182 | |
| 183 | void 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 | |
| 199 | void AddVariable(asIScriptEngine *engine, string &arg) |
| 200 | { |
no test coverage detected