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


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

Re: Input[] Function Evaluation

From Szabolcs <szhorvat@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Input[] Function Evaluation
Date 2012-03-01 10:33 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jinja0$cst$1@smc.vnet.net> (permalink)
References <jicth9$elq$1@smc.vnet.net>

Show all headers | View raw


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

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


Thread

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

csiph-web