Re: mac script size revisited
Re: mac script size revisited
- Subject: Re: mac script size revisited
- From: Michael Glasser <email@hidden>
- Date: Thu, 10 Apr 2003 13:38:05 -0700
On Wednesday, April 9, 2003, at 11:08 PM, Richard Morton wrote:
On Thursday, April 10, 2003, at 01:38 PM, Michael Glasser wrote:
One problem... you say for sanities sake that I should not rely on
globals... well, apparently I am not sane. :)
You're not alone either. ;)
I know. The voice. They are ALWAYS there.
Any ideas on how I can deal with globals? Just one variable... if
that helps...
Three methods come to mind immediately.
(1) Pass it to & return it from to every handler that needs it:
I am doing a little of this now....
(2) Limit the use of the global to one library only and declare it as
a global/property in that. It can still be returned to the main
script if/when required.
I do this quite a bit... have too many globals. Working of reducing
the number
(3) Redesign your script so the global is no longer required. This
is not always easy, but eliminating dependencies on external values
really helps with debugging, maintaining & re-using code. It may also
push you toward an improved overall structure - time consuming in the
short term, but you'll be better off in the long run.
I have done SOME of this... must do more. Think any of the voices will
help me?
Thanks... in testing now to see if my mess of a program will work
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.