[R] Prompt with scan()

Prof Brian D Ripley ripley at stats.ox.ac.uk
Thu Sep 6 08:59:33 CEST 2001


On Wed, 5 Sep 2001, Ben Bolker wrote:

>   Do you mean readline()?
>
> readline has a 32-character limit, which you can get around as follows:
>
>  myreadline <- function(prompt="") {
>   cat(prompt)
>   readLines(n=1)
> }

For the record, that's not the same thing.  Consider the effects of sink().
Using stderr() would be safer, but not 100% the same.

Is there a real need to raise the 32-char limit?  We can very easily do so
(or users can: just change

#define CONSOLE_PROMPT_SIZE     32

in src/main/scan.c)  There does need to be a limit though: what do you
want?

-- 
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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list