• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: mac script size revisited
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: mac script size revisited (From: Richard Morton <email@hidden>)

  • Prev by Date: Re: Bug in iTunes AppleScript Implementation? (bounds of window)
  • Next by Date: Re: Eudora Settings
  • Previous by thread: Re: mac script size revisited
  • Next by thread: Re: mac script size revisited
  • Index(es):
    • Date
    • Thread