Re: Can a handler return more than one result?
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