• 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: Return from Handler... What am I Missing Here?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Return from Handler... What am I Missing Here? (From: "S. J. Cunningham" <email@hidden>)
 >Re: Return from Handler... What am I Missing Here? (From: Deivy Marck Petrescu <email@hidden>)
 >Re: Return from Handler... What am I Missing Here? (From: "S. J. Cunningham" <email@hidden>)
 >Re: Return from Handler... What am I Missing Here? (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Return from Handler... What am I Missing Here?
  • Next by Date: Re: Return from Handler... What am I Missing Here?
  • Previous by thread: Re: Return from Handler... What am I Missing Here?
  • Next by thread: Re: Return from Handler... What am I Missing Here?
  • Index(es):
    • Date
    • Thread