reading a string from the keyboard



Maybe you can use this function

(defun $readstring (&rest args)
    (princ *prompt-prefix*)
    (mfuncall '$apply '$print `((mlist simp) , at args))
    (princ *prompt-suffix*)
    (force-output)
    (read-line *query-io* nil nil))

I works like readonly, but it reads a string.

Andrej



On Wed, Sep 23, 2009 at 8:39 PM, Jussi Eloranta <Jussi.Eloranta at csun.edu> wrote:
> Hi,
>
> I have a simple question. I want to read a string from the keyboard,
> which may contain spaces etc.
>
> Previously, I used the following:
>
> readline(?\*standard\-input\*)
>
> but this does not seem to work anymore with the new wxmaxima (it works
> fine if I run maxima in a terminal window). I suspect that there is some
> standard way of doing this? If I use readonly(), then I get:
>
> 1 2
> Incorrect syntax: 2 is not an infix operator
>
> where I entered a string "1 2".
>
> Help?
>
>
>
> Jussi Eloranta
> Cal State Northridge
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>