Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added multiple line and semicolon-separated commands execution in R c…
…onsole

Probably the logic should be moved to RBusinessManager
Not sure how it works on Win and Linux
  • Loading branch information
Valentin Georgiev committed Aug 25, 2011
1 parent 30cae6b commit 68dbce0
Showing 1 changed file with 23 additions and 10 deletions.
Expand Up @@ -36,17 +36,30 @@ public void createPartControl(Composite parent) {
*/
@Override
protected String executeCommand( String command ) {
String returnVal;
if (r == null) {
getRBusinessManager();
if (r == null)
returnVal = "Waiting for R Manager, please try again.";
else returnVal = r.eval(command);
returnVal = r.eval(command);
/*
* TODO
* move what possible to RBusinessManager
* test on Windows and Linux
*/
String returnVal = null;
String[] commands = null;
String[] lines = null;
commands = command.split(";");
for (String semics : commands) {
lines = semics.split("\n");
for (String cmd : lines){
if (r == null) {
getRBusinessManager();
if (r == null)
returnVal = "Waiting for R Manager, please try again.";
else returnVal = r.eval(cmd);
returnVal = r.eval(cmd);
}
else returnVal = r.eval(cmd);
echoCommand(cmd);
printMessage(returnVal);
}
}
else returnVal = r.eval(command);
echoCommand(command);
printMessage(returnVal);
return returnVal;
}

Expand Down

0 comments on commit 68dbce0

Please sign in to comment.