Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8755 > unrolled thread
| Started by | Don <donabc@comcast.net> |
|---|---|
| First post | 2012-02-26 09:20 +0000 |
| Last post | 2012-03-01 10:33 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | Don <donabc@comcast.net> |
|---|---|
| Date | 2012-02-26 09:20 +0000 |
| Subject | Input[] 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]
| From | Szabolcs <szhorvat@gmail.com> |
|---|---|
| Date | 2012-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