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


Groups > comp.soft-sys.math.mathematica > #8755 > unrolled thread

Input[] Function Evaluation

Started byDon <donabc@comcast.net>
First post2012-02-26 09:20 +0000
Last post2012-03-01 10:33 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Input[] Function Evaluation Don <donabc@comcast.net> - 2012-02-26 09:20 +0000
    Re: Input[] Function Evaluation Szabolcs <szhorvat@gmail.com> - 2012-03-01 10:33 +0000

#8755 — Input[] Function Evaluation

FromDon <donabc@comcast.net>
Date2012-02-26 09:20 +0000
SubjectInput[] Function Evaluation
Message-ID<jicth9$elq$1@smc.vnet.net>
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

[toc] | [next] | [standalone]


#8804

FromSzabolcs <szhorvat@gmail.com>
Date2012-03-01 10:33 +0000
Message-ID<jinja0$cst$1@smc.vnet.net>
In reply to#8755
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:

http://mathematica.stackexchange.com/questions/1944/how-can-you-stop-ordering-of-inputfield-entries

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web