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: "S. J. Cunningham" <email@hidden>
- Date: Sat, 17 Oct 2015 16:48:23 -0400
On Oct 17, 2015, at 1:54 PM, Deivy Marck Petrescu wrote:
>
> On Oct 17, 2015, at 1:22 PM, S. J. Cunningham <email@hidden> wrote:
>
>> Another rookie error, I suppose. Why does the first case work and the second fail?
>>
>> -- Case 1
>> handlerName()
>> if errNum of the result ≠ 0 then
>> display dialog "Error " & errNum of the result & ": " & errMsg of the result
>> else
>> display dialog "No Error"
>> end if
>> --> "Error -1: x"
>>
>> -- Case 2
>> if errNum of handlerName() ≠ 0 then
>> display dialog "Error " & errNum of the result & ": " & errMsg of the result
>> return
>> end if
>> display dialog "No Error"
>> --> Runtime Error: "Can’t make errNum of "x" into type Unicode text."
>>
>> on handlerName()
>> set yyy to "x"
>> return {errNum:-1, errMsg:yyy}
>> end handlerName
>
>
> The second case does not fail, it works correctly.
> if you log the result of your call, it returns "x", which does not have the errNum property.
>
> Deivy
Well, OK. But why does it return "x" instead of {errNum:-1, errMsg:"x"}
Steve
------------------
OS X 10.6.8, AppleScript 2.1.2
_______________________________________________
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