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


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

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

From Simon <simonjtyler@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Can't make Input[] work the way I want it to.
Date 2011-07-27 10:19 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j0oonu$krv$1@smc.vnet.net> (permalink)

Show all headers | View raw


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 comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web