MathGroup Archive 2012

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

Search the Archive

Re: Function Evaluation


InputField can handle its input as a string.

s = ""; InputField[Dynamic[s], String,
 FieldHint -> "Enter series of integers"]

This will handle comma- or space-separated input or a mix of the two,
with or without List brackets:

response = "{" <>
    StringReplace[
     StringReplace[s, "," -> " "],
     Whitespace -> ","] <> "}" //
   ToExpression // Flatten


Bob Hanlon

On Sun, Feb 26, 2012 at 4:19 AM, Don <donabc at comcast.net> 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.
>
> Thank you.
>
> Don
>



  • Prev by Date: Re: Packages - trivial question
  • Next by Date: Re: Packages - trivial question
  • Previous by thread: Input[] Function Evaluation
  • Next by thread: Error in solving inequalities