• 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: Forcing an applet to quit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing an applet to quit


  • Subject: Re: Forcing an applet to quit
  • From: Cal <email@hidden>
  • Date: Mon, 8 Jan 2001 23:26:15 GMT

"Marc K. Myers" <email@hidden> wrote:

> Paul Berkowitz wrote:
> >
> > On 1/8/01 10:50 AM, "Stephen Gross" <email@hidden> wrote:
> >
> > > How can I make an applet abort? I know I can use "return x," from the
> > > main routine, but what if I want it to bomb out from a subroutine?
> > >
> >
> > error number -128
> >
> > Is equivalent to "Cancel" and will end it from anywhere.
>
> I tried this:
>
> on run
> beep
> doIt()
> beep
> end run
>
> on doIt()
> error -128
> end doIt
>
> as well as a bunch of other things in the handler that would make AS
> unhappy ("set a to 1 / 0"). In each case, the script beeped twice. I
> was surprised that it returned from the handler after the error. Is
> there a way to halt execution in the handler itself?

Marc,

You forgot the word "number" in your "error" command:

error number -128

Without the word "number", you've basically told AppleScript to error with an
Error Message String of "-128", instead of the error numbered -128.

Cal


-------------------------------------------------
This message was sent via http://webmail.his.com.
http://www.his.com/


  • Follow-Ups:
    • Re: Forcing an applet to quit
      • From: Chris Nebel <email@hidden>
  • Prev by Date: Re: AppleCD Audio Player or Addition Equivilent
  • Next by Date: Re: Settings properties from a loaded script
  • Previous by thread: Re: Forcing an applet to quit
  • Next by thread: Re: Forcing an applet to quit
  • Index(es):
    • Date
    • Thread