MathGroup Archive 2012

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

Search the Archive

Re: Function Evaluation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125202] Re: Function Evaluation
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Tue, 28 Feb 2012 00:47:17 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201202260919.EAA14996@smc.vnet.net>

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