MathGroup Archive 2011

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

Search the Archive

Re: about the use of button

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115268] Re: about the use of button
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Thu, 6 Jan 2011 02:02:49 -0500 (EST)

It would be nice if the "=" signs STOPPED being doubled. This is a recent  
addition to our action-packed lives, I take it?

Bobby

On Wed, 05 Jan 2011 03:35:22 -0600, W. Craig Carter <ccarter at mit.edu>  
wrote:

> Hello Bobby,
> This appears to be one of those cases where the "equals sign" got turned  
> into two "equals signs" by the email client, the first two lines are  
> single "="
> Craig
>
> On 4 Jan,   2011, at 4:29 PM, DrMajorBob wrote:
>
>> Clicking the button gives an error message:
>>
>> carWeight == tareWeight;
>> personNumber == 0;
>>
>> Row[{Button["A person enters", {carWeight += 60, personNumber++}],
>>  Dynamic[{carWeight, personNumber}]}]
>>
>> AddTo::rvalue: carWeight is not a variable with a value, so its value  
>> cannot be changed. >>
>>
>> Increment::rvalue: personNumber is not a variable with a value, so its  
>> value cannot be changed. >>
>>
>> Bobby
>>
>> On Tue, 04 Jan 2011 03:26:40 -0600, W. Craig Carter <ccarter at mit.edu>  
>> wrote:
>>
>>> 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++}]]
>>>
>>>
>>
>>
>> --
>> DrMajorBob at yahoo.com
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: original meaning of System` functions
  • Next by Date: Re: original meaning of System` functions
  • Previous by thread: Re: about the use of button
  • Next by thread: Re: about the use of button