MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Input[] Function Evaluation

  • To: mathgroup at
  • Subject: [mg125229] Re: Input[] Function Evaluation
  • From: Szabolcs <szhorvat at>
  • Date: Thu, 1 Mar 2012 05:32:21 -0500 (EST)
  • Delivered-to:
  • References: <jicth9$elq$>

On Sunday, 26 February 2012 11:20:41 UTC+2, Don  wrote:
> I would like to use Input[] to prompt the user
> to input a series of separate integers, separated by spaces.
> The Input function wants to multiply the series of integers immediately.  I am trying to capture the series of integers as a list of separate integers.
> How can I do this?
> SetAttributes[Input, HoldAll]  does not work.

You can use InputString[] to get the input as a string, parse it (ToExpression, especially its third argument will be used.  Please see the docs.  Also see StringSplit)

However, I'd suggest using InputField instead which works with Dynamic technology.  To make it read a string, use InputField[x, String].  A similar issue has been discussed here:

  • Prev by Date: Re: Line Numbers in Files
  • Next by Date: Re: Line Numbers in Files
  • Previous by thread: Re: Line Numbers in Files
  • Next by thread: Re: Plotting colorfunctions over multiple parametric curves