• 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: Michelle Steiner <email@hidden>
  • Date: Mon, 8 Nov 2004 18:14:11 -0700

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

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.

set x to 3 set y to 4

set {mult_result, add_result} to multiply_and_add(x, y)

on multiply_and_add(input1, input2)
	set mult to input1 * input2
	set add to input1 + input2
	return {mult, add}
end multiply_and_add

--> {12,7}

--
Nobody ever procrastinated their way to the top.

_______________________________________________
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: Can a handler return more than one result?
  • Next by Date: Re: Bridge anyone? [not off topic]
  • 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