Re: including source code
Re: including source code
- Subject: Re: including source code
- From: Simon Topliss <email@hidden>
- Date: Sat, 21 Feb 2009 17:15:18 +0000
Hi Jim,
What I would do, and have done personally, is to break your libraries
into separate, related libraries.
For example, I have separate libraries named lib_strings, lib_numbers,
lib_write_to_file, etc. I've got 21 separate, self-contained 'master
libraries'.
Each of these separate libraries can load other dependent libraries
when called. So, if the lib_numbers requires the lib_strings script,
it loads this when it is loaded.
If you want an idea of an approach to achieve this, look at http://applemods.sourceforge.net/modBrowser.html
. Hamish (has) has a great selection of ready-made libraries that I
used as a starting point. His implementation is somewhat confusing for
most applescript users, but it's well worth trying to understand why
and how it's done.
Simon
On 20 Feb 2009, at 20:22, Jim Brandt wrote:
OK, so I've been writing scripts off and on (more off than on) for
maybe ten years now. While I first explored AS under OS9, I jumped
to OneClick because I found it more consistant back then. When OSX
became the OS of choice, I was forced to redo everything in AS.
The road has been challanging, but enlightening.
My question has to do with reusable code. Currently I have a half
dozen
handlers that I keep in a single file and load using a "load script"
command. However, this means I load a fair amount of source code
that I may not need for the particular script I'm writing, in order to
get a single function that I do need. Is there a better way to do
this?
Would I be better off loading each handler as a seperate piece of
code?
Is there another option?
TIA, Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden