- Timestamp:
- Aug 19, 2010, 4:57:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/core/TclBind.cc
r7174 r7189 134 134 const std::string& command = stripEnclosingBraces(args.get()); 135 135 136 if (!CommandExecutor::execute(command, false)) 136 bool success; 137 const std::string& result = CommandExecutor::query(command, &success, false); 138 if (!success) 137 139 { 138 140 COUT(1) << "Error: Can't execute command \"" << command << "\"!" << std::endl; 139 141 } 140 142 141 if (CommandExecutor::getLastEvaluation().hasReturnvalue()) 142 return CommandExecutor::getLastEvaluation().getReturnvalue().getString(); 143 144 return ""; 143 return result; 145 144 } 146 145 … … 181 180 } 182 181 183 bool TclBind::eval(const std::string& tclcode)182 std::string TclBind::eval(const std::string& tclcode, bool* success) 184 183 { 184 if (success) 185 *success = true; 186 185 187 try 186 188 { 187 TclBind::getInstance().interpreter_->eval(tclcode); 188 return true; 189 return TclBind::getInstance().interpreter_->eval(tclcode); 189 190 } 190 191 catch (Tcl::tcl_error const &e) 191 192 { COUT(1) << "Tcl error: " << e.what() << std::endl; } 192 193 193 return false; 194 if (success) 195 *success = false; 196 return ""; 194 197 } 195 198 }
Note: See TracChangeset
for help on using the changeset viewer.