| 1454 | } |
| 1455 | |
| 1456 | ConsoleValueRef evaluate(const char* string, bool echo, const char *fileName) |
| 1457 | { |
| 1458 | ConsoleStackFrameSaver stackSaver; |
| 1459 | stackSaver.save(); |
| 1460 | |
| 1461 | if (echo) |
| 1462 | { |
| 1463 | if (string[0] == '%') |
| 1464 | Con::printf("%s", string); |
| 1465 | else |
| 1466 | Con::printf("%s%s", getVariable( "$Con::Prompt" ), string); |
| 1467 | } |
| 1468 | |
| 1469 | if(fileName) |
| 1470 | fileName = StringTable->insert(fileName); |
| 1471 | |
| 1472 | CodeBlock *newCodeBlock = new CodeBlock(); |
| 1473 | return newCodeBlock->compileExec(fileName, string, false, fileName ? -1 : 0); |
| 1474 | } |
| 1475 | |
| 1476 | //------------------------------------------------------------------------------ |
| 1477 | ConsoleValueRef evaluatef(const char* string, ...) |