Skip to content

Commit

Permalink
Fix Bug 3053
Browse files Browse the repository at this point in the history
"Newlines lost when routing R console output to the BSL console"
  • Loading branch information
Valentin Georgiev committed Feb 8, 2012
1 parent 5690f0c commit 7f7c89c
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -427,8 +427,11 @@ else if (command.contains("quartz"))
RObject data = rservi.evalData("capture.output(print("+command+"))", null); // capture.output(print( )) gives a string output from R, otherwise R objects. The extra pair of () is needed for the R function print to work properly.
RStore rData = data.getData();
StringBuilder builder = new StringBuilder();
for(int i=0;i<rData.getLength();i++) {
int n = rData.getLength();
for(int i=0;i<n;i++) {
builder.append(rData.getChar(i));
if (i+1 < n)
builder.append(NEWLINE);
}
returnVal = builder.toString();
}
Expand All @@ -439,7 +442,7 @@ else if (command.contains("quartz"))
error.printStackTrace();
returnVal = "Error: " + error.getMessage();
}
logger.debug(" -> " + returnVal);
logger.debug(" -> "+ NEWLINE + returnVal);
}
return returnVal;
}
Expand Down

0 comments on commit 7f7c89c

Please sign in to comment.