MathGroup Archive 2011

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

Search the Archive

Re: about the use of button


Hello Yang,
Try this:

----

carWeight == tareWeight;
personNumber == 0;

Row[{Button["A person enters", {carWeight +== 60, personNumber++}],
  Dynamic[{carWeight, personNumber}]}]

-----

You must avoid underscores "_" in variable names. It is a good habit to use an lower case letter to begin each variable name. Notice that Dynamic sits outside the button--that is the only place you need to see the current (i.  e., dynamic) values.

Craig


On 28 Dec,   2010, at 6:51 AM, yang wrote:

> Button["A person enters",
> {Dynamic[car_weight+==60],Dynamic[person_number++}]]



  • Prev by Date: quadp
  • Next by Date: Re: Fragmenting a Rectangle
  • Previous by thread: Re: quadp
  • Next by thread: Re: about the use of button