| 1507 | } |
| 1508 | |
| 1509 | ConsoleValue evaluate(const char* string, bool echo, const char *fileName) |
| 1510 | { |
| 1511 | ConsoleStackFrameSaver stackSaver; |
| 1512 | stackSaver.save(); |
| 1513 | |
| 1514 | if (echo) |
| 1515 | { |
| 1516 | if (string[0] == '%') |
| 1517 | Con::printf("%s", string); |
| 1518 | else |
| 1519 | Con::printf("%s%s", getVariable( "$Con::Prompt" ), string); |
| 1520 | } |
| 1521 | |
| 1522 | if(fileName) |
| 1523 | fileName = StringTable->insert(fileName); |
| 1524 | |
| 1525 | CodeBlock *newCodeBlock = new CodeBlock(); |
| 1526 | return std::move(newCodeBlock->compileExec(fileName, string, false, fileName ? -1 : 0)); |
| 1527 | } |
| 1528 | |
| 1529 | //------------------------------------------------------------------------------ |
| 1530 | ConsoleValue evaluatef(const char* string, ...) |