>How cool. Thanks. Can you explain why this works?
>
>
>  > maybe you try a oneliner:
>>
>  > on mouseUp
>>   the text of field "s1" = ""& (5500 - value(the text of field "s1"))
>>  end
>  >


It can be a bit shorter:

on mouseUp
   put 5500 - value(field "s1") into field "s1"
end


When dealing with fields Director is smart enough to work out that 
the text is a number, so you could remove the value part of the above 
line. The reason it might be needed is for when you first start and 
the field might be empty. It also helps keep the number as an integer.

Doing 5500 - 0 gives you 5500, and 5500 - 5500 gives you 0, hence the 
field toggles between the two numbers.


-- 
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to