RE: Regarding Handlers...
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. |
----------------------------------------------------------------------