Creating reusable code libraries

Kaveh Bazargan kaveh at focalimage.com
Sun Nov 21 16:59:26 EST 2004


At 11:53 am -0600 21/11/04, Gordon Tillman wrote:

[...]

>> What would be the best way in Rev. to create a
>> reusable code library - e.g. to do 3D mathematics?
>> Would I create it as a stack script in an otherwise
>> empty stack and then load the stack into my apps and
>> keep it invisible? Do all stacks have to have a
>> toplevel window?
>
>This is how I do reusable code libraries.  I create a very simple stack
>with one card and one or more buttons on the card.  The button script
>contains the reusable code.

Another alternative is the very useful Custom Property. I have one button
called "scripts", and I have a custom property for each AppleScript. This
way there is just one button, and all scripts are listed nicely in the
Inspector.

For example I have a custom property called "open_files". I run the script
by saying:

do open_files of btn "scripts" as AppleScript
-- 

Kaveh Bazargan
http://www.focalimage.com/
http://www.holographer.org/


More information about the Use-livecode mailing list