Re: Beginner--Simplest question: How to control some values in Input dialog box
- To: mathgroup at smc.vnet.net
- Subject: [mg67752] Re: Beginner--Simplest question: How to control some values in Input dialog box
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 6 Jul 2006 06:53:38 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <e8fuj0$qm0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
abdou.oumaima at hotmail.com wrote: > Hi mathematica users, > > In the begining of my program, I've to initialize some parametres. I would like to do some control on them. > > I put: > > CN= Input["Give an positive integer value to CN"]; > c= Input["Give a positive real value to c less than 0.9"] > > How to control the values CN and c so that they verify my conditions in the message box? > > Any help please. > > Thank you for all of you > > Link to the forum page for this post: > http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Special:Forum_ViewTopic&pid=11670#p11670 > Posted through http://www.mathematica-users.org [[postId=11670]] > > What about the following loops? CN =. ; While[ !(IntegerQ[CN] && Positive[CN]), CN = Input["Give an positive integer value to CN"]] c = 0; While[ !(RealQ[c] && 0 < c < 0.9), c = Input[ "Give a positive real value to c less than 0.9"]] HTH, Jean-Marc