• 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: Can a handler return more than one result?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can a handler return more than one result?


  • Subject: Re: Can a handler return more than one result?
  • From: Graff <email@hidden>
  • Date: Tue, 09 Nov 2004 00:19:55 -0500

As others have shown you (but not actually told you) just return a list of all the variables you want to return:
----
on doSomething()
set thingOne to 5
set thingTwo to "boo"


    return {thingOne, thingTwo}
end

set {firstPart, secondPart} to doSomething()

firstPart
--> 5

secondPart
--> "boo"
----

:-)

- Ken

On Nov 8, 2004, at 7:55 PM, Eric Geoffroy wrote:

I dutifully checked my Neuberg book before asking.

I have a handler that sets two variables. I'd like to return them both as a result of the handler.
For reasons I don't yet understand, the scope is local and needs to break out of its little shell.


Declaring both variables as global is an option, but it makes me feel dirty because of the way the books talks about them.

_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Can a handler return more than one result? (From: Eric Geoffroy <email@hidden>)

  • Prev by Date: Re: Changing the "forward" tear line
  • Next by Date: Re: Can a handler return more than one result?
  • Previous by thread: Re: Can a handler return more than one result?
  • Next by thread: Re: Can a handler return more than one result?
  • Index(es):
    • Date
    • Thread