[R-SIG-Mac] Question!

Simon Urbanek simon.urbanek at r-project.org
Wed Jul 11 13:39:24 CEST 2012


On Jul 2, 2012, at 6:38 AM, Nagode, Marko wrote:

> Dear Sir,
>  
> One of the rebmix package users informed me about an error occurring when the rebmix runs from R console on mac:
>  
> <image001.png>
>  
> I assume that the problem is caused by:
>  
> Rprintf("%sTime left %2.1f sec", CL, TimeLeft);
> R_FlushConsole();
> R_ProcessEvents();
>  
> in my C code, where:
>  
> #ifndef CL
> #define CL"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
> #endif
>  
> As you can see I try to inform the user of the rebmix about the time needed to finish the calculation. Consequently I first clean the line by calling backshlash several times as the exact length of the string is supposed not to be known. Next TileLeft is written. On R console one should, e.g., observe Time left = 0.3 sec.
> <image002.png>
> <image005.jpg>
>  
> On other platforms my code runs error free. On CRAN checks: rebmix results the status of all checks is OK.
>  
> I assume that \b causes troubles. Could you please give me some idea on how to avoid the problem.
>  

Is there any reason you're not simply using \r ? The Mac GUI takes \b literally, supports full-document editing and you're simply backspacing beyond what you wrote.

Cheers,
Simon



> Thank you in advance.
>  
> Best regards,
>  
> Marko Nagode
>  
> ---------------------------------------------
> prof. Marko Nagode, Ph.D.
> University of Ljubljana
> Faculty of Mechanical Engineering
> Aškerčeva 6
> 1000 Ljubljana
> Slovenia
> Phone: +386 1 4771 507
> Fax: +386 1 4214 074
> E-mail: marko.nagode at fs.uni-lj.si
>  
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list