External functions

Sarah Reichelt sarah.reichelt at gmail.com
Mon Feb 4 16:09:08 EST 2008


> My problem due to my inexperience in Revolution is how organize the calls
> into the stacks. What is better and what is the normal way to put the
> handlers, functions, etc...

My general rule is to place each handler or function as low in the
hierarchy as practical. If a button has a single use, then it contains
it's own handler. If there is a group of buttons that all use the same
function, then I might put that handler in the group script. For
handlers/functions used by many of the objects on a card, I'll put the
handler/function in the card script and for handlers/functions used by
everything, I use the stack script.

That covers an individual stack, but there will be handlers/functions
that are used by multiple stacks. For these, the options are to use
the stack script of the mainStack or to make a library stack. To make
a library stack, write all the handlers in the stack script of a
particular stack and then "start using" that stack. The library can be
a sub stack of your mainStack or can be completely independent, so
long as you include it in your app when creating a standalone.

There are also frontScripts & backScripts, but they tend to be more
special purpose.

Richard Gaskin has a very useful article about the message, but I
can't find the URL at the moment (Richard?). He also contributed to
the Scripting Conferences with one titles "Message
Hierarchy". You can download it from
<http://support.runrev.com/scriptingconferences/>.

HTH,
Sarah



More information about the Use-livecode mailing list