Re: Simple question
- To: mathgroup at smc.vnet.net
- Subject: [mg59304] Re: Simple question
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Fri, 5 Aug 2005 01:21:30 -0400 (EDT)
- References: <dcschl$q3c$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hello, You should use InputString rather than Input (which inputs a Mathematica expression). The following code is simple to understand but not particularly elegant: While[True, p=InputString["Please type the conditions"]; If[p=="S", p=p1; Break[] ]; If[p="C", p=p2; Break[] ]; ] In general, I would not use Input or InputString - those functions belong to the early days of Mathematica, and any interface that you make with them will never look good! I would start by developing your code using the usual notebook facilities - maybe just set the value of p in a cell and edit it as needed. Alternatively, the choice of p could just be one argument to a function that you define. Later, when you are ready, if you feel you need a good interface to your program - say because you want others to use it - explore the GUIKit, or the SuperWidgetPackage that is available free from my site. The SWP simplifies and extends GUIKit programming. David Bailey http://www.dbaileyconsultancy.co.uk