Re: [Rd] printf capture

2007-04-20 Thread mel
Simon Urbanek a écrit : > The wrapper: > > #include > > int printf(const char *format, ...) { > va_list (ap); > va_start(ap, format); > Rvprintf((char*)format, ap); > va_end(ap); > return 0; > } > > If you link this in your project (simply create a separate object file > with this),

Re: [Rd] printf capture

2007-04-19 Thread Simon Urbanek
On Apr 19, 2007, at 10:31 AM, mel wrote: > Prof Brian Ripley a écrit : > >> You can always link in a wrapper that defined printf and passes >> the arguments to Rprintf. > > I apologize but confess i didn't completely understand this > suggestion. > The wrapper: #include int printf(const c

Re: [Rd] printf capture

2007-04-19 Thread mel
Prof Brian Ripley a écrit : > You can always link in a wrapper that defined printf and passes the > arguments to Rprintf. I apologize but confess i didn't completely understand this suggestion. > It's documented in 'Writing R Extensions'. > The defines used for compatibility with @Sl{} someti

Re: [Rd] printf capture

2007-04-12 Thread Prof Brian Ripley
On Thu, 12 Apr 2007, mel wrote: Prof Brian Ripley a écrit : If you are using Rgui (it should work under rterm) yes indeed, it works under rterm there is no C-level 'stdout' file stream (the normal state for Windows GUI programs), so no way to capture it inside R. Aie ! (I feared this ans

Re: [Rd] printf capture

2007-04-12 Thread mel
Prof Brian Ripley a écrit : > If you are using Rgui (it should work under rterm) yes indeed, it works under rterm > there is no C-level 'stdout' file stream (the normal state > for Windows GUI programs), so no way to capture it inside R. Aie ! (I feared this answer). Thanks however for the exp

Re: [Rd] printf capture

2007-04-12 Thread Peter Dalgaard
Prof Brian Ripley wrote: > If you are using Rgui (it should work under rterm) there is no C-level > 'stdout' file stream (the normal state for Windows GUI programs), so no > way to capture it inside R. > > On Thu, 12 Apr 2007, mel wrote: > > >> printf capture >> >> Dear All, >> >> I'm running

Re: [Rd] printf capture

2007-04-12 Thread Prof Brian Ripley
If you are using Rgui (it should work under rterm) there is no C-level 'stdout' file stream (the normal state for Windows GUI programs), so no way to capture it inside R. On Thu, 12 Apr 2007, mel wrote: > printf capture > > Dear All, > > I'm running R-2.4.1 on WindowsXP. > I wrote a small C++ D

[Rd] printf capture

2007-04-12 Thread mel
printf capture Dear All, I'm running R-2.4.1 on WindowsXP. I wrote a small C++ DLL using Rprintf() and all works fine dyn.load(), is.loaded('f1'), Rprintf(), .C(), all is ok. Now, the worry : I use also a 3rd party piece of C++ program which was not designed for R and uses printf(). I though on