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


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

Re: Can't make Input[] work the way I want it to.

Started bySimon <simonjtyler@gmail.com>
First post2011-07-27 10:19 +0000
Last post2011-07-27 10:19 +0000
Articles 1 — 1 participant

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


Contents

  Re: Can't make Input[] work the way I want it to. Simon <simonjtyler@gmail.com> - 2011-07-27 10:19 +0000

#4005 — Re: Can't make Input[] work the way I want it to.

FromSimon <simonjtyler@gmail.com>
Date2011-07-27 10:19 +0000
SubjectRe: 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]]}]

[toc] | [standalone]


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


csiph-web