Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4005 > unrolled thread
| Started by | Simon <simonjtyler@gmail.com> |
|---|---|
| First post | 2011-07-27 10:19 +0000 |
| Last post | 2011-07-27 10:19 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Can't make Input[] work the way I want it to. Simon <simonjtyler@gmail.com> - 2011-07-27 10:19 +0000
| From | Simon <simonjtyler@gmail.com> |
|---|---|
| Date | 2011-07-27 10:19 +0000 |
| Subject | Re: Can't make Input[] work the way I want it to. |
| Message-ID | <j0oonu$krv$1@smc.vnet.net> |
Put brackets {} around the input.
1,2,3 is not a good Mathematica expression, so Input can only return the Box expression. You could do some simple syntax checking to find when an expression like "1,2,3" (x=RowBox[{"1", ",", "2", ",", "3"}]) has been entered and then fix it using, e.g., ToExpression@RowBox[{"{", x, "}"}]
Or you could prompt for the correct form using something like
x = Input["Input a list", {Placeholder[Subscript["e", 1]], Placeholder[Subscript["e", 2]], Placeholder[\[Ellipsis]]}]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web