From andy_liaw at merck.com  Sat Feb  4 19:45:59 2006
From: andy_liaw at merck.com (Liaw, Andy)
Date: Sat, 4 Feb 2006 13:45:59 -0500
Subject: [Rd] Rprintf loop status does not print under windows
Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFAFED7C7@usctmx1106.merck.com>



> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of Duncan Murdoch
> Sent: Saturday, February 04, 2006 1:23 PM
> To: Andrew Finley
> Cc: r-devel at r-project.org
> Subject: Re: [Rd] Rprintf loop status does not print under windows
> 
> 
> On 2/4/2006 1:14 PM, Andrew Finley wrote:
> > Hello,
> > I am writing a c/c++ extension package that does some mcmc 
> sampling, and
> > periodically writes the sampling status to the terminal via 
> Rprintf.  So in
> > my sampling loop I have:
> > 
> > if(status == 100){
> >   Rprintf("%i...", s);
> >   status = 0;
> > }
> > status++;
> > 
> > Under linux/unix this works fine, but under windows the 
> status is not
> > printed.  Am I missing something?
> 
> Looks like you have buffering enabled (the default).  In the 
> Misc menu 
> item, uncheck "buffered output" and you should see things sooner (but 
> slower).

... or add something like this in your C code:

#ifdef win32
	    R_FlushConsole();
#endif

Andy
 
> Duncan Murdoch
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
>



[Rd] Rprintf loop status does not print under windows
Liaw, Andy