MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: inputing nothing in a manipulate box

  • To: mathgroup at
  • Subject: [mg101761] Re: inputing nothing in a manipulate box
  • From: Simon <simonjtyler at>
  • Date: Thu, 16 Jul 2009 08:19:53 -0400 (EDT)
  • References: <h3kdhk$g72$>

On Jul 15, 7:11 pm, Lobotomy <labb... at> wrote:
> If you have a Manipulate command with a function generating a graph
> and then input nothing there will be an error. nothing=!=0 in this
> case. with nothing i mean, erasing whatever number is there and
> pressing enter without entering 0 or any other number.
> how can this be solved? i want that nothing == 0 in my calculations
> when one uses the input box


If nothing is entered into the InputField, then it returns Null
The following will check for that
Manipulate[Dynamic@If[x == Null, 0, x], {x, 0, 1}]

Maybe more generally you want to have any non-numeric value changed to
zero, eg
ForceNumber = If[NumericQ@#, #, 0] &;
Manipulate[Graphics[Point[ForceNumber /@ {x, y}], PlotRange -> {{-1,
1}, {-1, 1}}, Frame -> True], {{x, 0}, -1, 1}, {{y, 0}, -1, 1}]


  • Prev by Date: Re: Re: Refine, assumptions, domains
  • Next by Date: Calculus in Dirac Notation
  • Previous by thread: Re: inputing nothing in a manipulate box
  • Next by thread: Determine if a parameter is a function