Hi, I'm sure this issue has come up before, but searching the archives didn't lead me to a solution or resolution of the issue. I'd like to indicate progress of a calculation from within a C shared library to the R GUI. The apparent function call is flush.console() after RPrintf, but it isn't clear to me what the easiest way to do this is. Would it be possible to add a flag to RPrintf to have this done implicitly? Thanks, chris [[alternative HTML version deleted]]
Prof Brian Ripley
2005-Sep-20 18:27 UTC
[Rd] indicating progress in RGui from a c function
On Tue, 20 Sep 2005, Chris Paulse wrote:> I'm sure this issue has come up before, but searching the archives didn't > lead me to a solution or resolution of the issue.It is documented in the rw-FAQ: Q8.8 in the R-2.2.0-alpha version.> I'd like to indicate progress of a calculation from within a C shared > library to the R GUI. The apparent function call is flush.console() after > RPrintf, but it isn't clear to me what the easiest way to do this is. Would > it be possible to add a flag to RPrintf to have this done implicitly?No. It's a varargs function and we cannot go round changing the API.> [[alternative HTML version deleted]]Please don't send HTML mail as we do ask in the posting guide. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 20 Sep 2005, cpaulse at aecom.yu.edu wrote:> I'd like to indicate progress of a calculation from within a C > shared library to the R GUI. The apparent function call is > flush.console() after RPrintf, but it isn't clear to me what the > easiest way to do this is. Would it be possible to add a flag to > RPrintf to have this done implicitly?When you do get this sorted out, you may want to consider a verbose option that toggles such updating of the GUI. When users want to run code in a non-interactive mode, such output can get in the way. You could use interactive() to determine a default value for the verbose option. Best, + seth