Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8775

Re: Function Evaluation

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Function Evaluation
Date 2012-02-28 05:48 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jihprp$91c$1@smc.vnet.net> (permalink)
References <201202260919.EAA14996@smc.vnet.net>

Show all headers | View raw


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@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
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Function Evaluation Bob Hanlon <hanlonr357@gmail.com> - 2012-02-28 05:48 +0000

csiph-web