• 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: Regarding Handlers...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Regarding Handlers...


  • Subject: RE: Regarding Handlers...
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 18 Dec 2000 16:45:43 -0800

On 12/18/00 4:35 PM, Robert Seckendorf <email@hidden> wrote

>Is it not possible to call a handler from within an if statement...
>I have tried the following but keep getting errors from the compiler.
>
>display dialog "What is your favorite color?" button {"Red", "Blue",
>"Neither"}
>default = 1
>set someValue to text returned from result
>if someValue = "Red" then
>goToRedHandler()
>else if someValue = "Blue" then
>goToBlueHandler()
>end if
>
>Any comments?

yes. Try this code instead:

display dialog "What is your favorite color?" buttons ,
{"Red", "Blue", "Neither"} default button 1
set someValue to button returned of result
if someValue = "Red" then
goToRedHandler()
else if someValue = "Blue" then
goToBlueHandler()
end if

on goToRedHandler()
display dialog "red"
end goToRedHandler

on goToBlueHandler()
display dialog "blue"
end goToBlueHandler

--Michelle

----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------


  • Prev by Date: Re: Regarding Handlers...
  • Next by Date: Re: Activer Server Pages using AS
  • Previous by thread: Re: Regarding Handlers...
  • Next by thread: Re: speak a message through the phone connection help
  • Index(es):
    • Date
    • Thread