Re: about the use of button
- To: mathgroup at smc.vnet.net
- Subject: [mg115037] Re: about the use of button
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Wed, 29 Dec 2010 05:56:51 -0500 (EST)
You cannot use an underscire in a variable name since the underscore is used to represent a pattern object.
Compound expressions use a semi-colon.
carWeight = 1000; personNumber = 0;
Button["A person enters", carWeight += 60; personNumber++]
{Dynamic[carWeight], Dynamic[personNumber]}
Bob Hanlon
---- yang <sun.lanyang at gmail.com> wrote:
=============
Hello, I'm a novice in Mathematica, now got a little puzzeled:
I'm intend to create a button which take two actions while clicked:
Button["A person enters",
{Dynamic[car_weight+=60],Dynamic[person_number++}]]
seems that this sentence won't work properly,
There must be some error with the grammar, right?
--
Bob Hanlon