Re: Return from Handler... What am I Missing Here?
Re: Return from Handler... What am I Missing Here?
- Subject: Re: Return from Handler... What am I Missing Here?
- From: Deivy Petrescu <email@hidden>
- Date: Sat, 17 Oct 2015 19:57:06 -0400
> On Oct 17, 2015, at 16:53 , Steve Mills <email@hidden> wrote:
>
>> On Oct 17, 2015, at 15:48, S. J. Cunningham <email@hidden> wrote:
>>
>> Well, OK. But why does it return "x" instead of {errNum:-1, errMsg:"x"}
>
> Because if errNum of handlerName() was the last operation that set the value of the result.
>
> Steve via iPhone
Well, yes and no!
I believe that “if then” returns no result.
So “result” is the last result before this call.
I am not saying that I know this, I am actually surprised.
But,
set x to 5
if x≠6 then return result
—> 5
When you call a handler on an if statement like above, it runs a bunch of operations before the result.
Interestingly, result is going to be the last operation before the return.
As I said, this is news to me.
Deivy Petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden