• 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: [Newbie Q] How to implement toggle switch?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie Q] How to implement toggle switch?


  • Subject: Re: [Newbie Q] How to implement toggle switch?
  • From: Erik Price <email@hidden>
  • Date: Fri, 7 Jun 2002 10:16:21 -0400

On Friday, June 7, 2002, at 04:05 AM, email@hidden wrote:

Based on the code you posted (shown at bottom), it would seem an appropriate
time to teach yourself about (a) handlers (called subroutines or functions or
libraries in other programming languages), and possibly (b) recursion.

A handler is a reusable snipped of code that resides at the bottom of the
AppleScript in it's own block, and is called as needed, being passed
information and returning information.

So, as with other scripting languages, you can use this handler/subroutine/function to either return a value OR to perform a collection of code. It doesn't have to be a true function (returns a value) or a true subroutine (just executes a chunk of code).

Last question -- does it have to be at the bottom of the script? Can I put the handler definition at the top? It feels better for me that way.


Erik




----

Erik Price
Web Developer Temp
Media Lab, H.H. Brown
email@hidden
_______________________________________________
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.

  • Follow-Ups:
    • Re: [Newbie Q] How to implement toggle switch?
      • From: Michael Terry <email@hidden>
References: 
 >RE: [Newbie Q] How to implement toggle switch? (From: email@hidden)

  • Prev by Date: Newbie: Automating Apple System Profiler
  • Next by Date: Re: Questions
  • Previous by thread: RE: [Newbie Q] How to implement toggle switch?
  • Next by thread: Re: [Newbie Q] How to implement toggle switch?
  • Index(es):
    • Date
    • Thread