• 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: Weird try block syntax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird try block syntax


  • Subject: Re: Weird try block syntax
  • From: Paul Skinner <email@hidden>
  • Date: Fri, 25 Jan 2002 17:57:57 -0500

As an interesting note, the 'on error X' construction disables the effect of the try block for other errors.

-----------------------------------------------------

try
error -128
on error -127
display dialog " You cancelled!"
end try
-->Execution error -128

-----------------------------------------------------

try
try
error -128
on error -127
display dialog " You cancelled!"
end try
on error
"You did something, but you didn't cancel."
end try

-->"You did something, but you didn't cancel."

-----------------------------------------------------


On Friday, January 25, 2002, at 02:48 PM, Serge Belleudy-d'Espinose wrote:

At 8:45 -0800 25/01/02, Paul Berkowitz wrote:

try

on error number -n

end

It's a basic feature of AppleScript, and must be in the ASLG, Serge.

Ok, my question was not clear enough. I _know_ about the following construct:

try

on error number errNum

end try

which puts the error number into the variable errNum, so that you can test it and use conditional error traping code.

My question is, when I see this:

try

on error number -1708 -- for example

end try

what does it do, does it trap only -1708? I _have_ read ASLG but couldn't find this construct, nor was I able to get something done with it. Time to go back to AS school?


Serge


--
Paul Skinner


References: 
 >Re: Weird try block syntax (From: "Serge Belleudy-d'Espinose" <email@hidden>)

  • Prev by Date: Re: What is the quoted form property of a string?
  • Next by Date: Re: Extract from digest
  • Previous by thread: Re: Weird try block syntax
  • Next by thread: Re: Weird try block syntax
  • Index(es):
    • Date
    • Thread