Subject: Re: variable list? Global var confusion

Sarah sarahr at genesearch.com.au
Tue Sep 2 01:16:00 EDT 2003


> Thanks for the clues. What I have is from 2 to 10 buttons on a card, 
> each adding/calculating percent of totals for all the corresponding 
> fields. Right now, I have the scripts in each button, but they all 
> access common variables. Is there a way to put all that scripting into 
> the card script? Or do you mean that I can declare the variables as 
> local in the card script, and then have the handlers in each button as 
> needed? There's no conflict within the individual card, only between 
> different cards.

Move the button scripts into the card script, giving them unique names 
e.g. buttonOne, buttonTwo. There are really two ways to call them after 
that:
1. Have a general mouseUp handler that first checks "the target" and 
then calls various handlers based on the target i.e. the thing clicked.
2. In your buttons, have their mouseUp handler call a card script 
handler directly.

The locals are only available in a single script (card script, button 
script etc.) so you are going to have to re-structure your scripts a 
bit.

>
> and unrelated -- what's the best way to reply to an individual post 
> within the digest?
No special way, just make sure you use the actual subject instead of 
the digest subject :-)

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/




More information about the use-livecode mailing list