Question
Question
- Subject: Question
- From: Michelle Steiner <email@hidden>
- Date: Sun, 3 Dec 2000 16:49:54 -0800
What unforeseen side effect does this script have, and why does it have
it? (Yeah, I know the answer, but I first had to experience the side
effect, because I did not foresee it when I wrote the script.)
--Michelle
set invalid to "What the????"
display dialog "enter the radius" default answer ,
"" buttons {"Compute diameter", " Compute area"}
set {myAnswer, myButton} to ,
{text returned, button returned} of the result
try
if myAnswer as number is greater than 0 then
if myButton is "compute cirumference" then
my displaydialog("cirumference", myAnswer * 2 * pi)
else
my displaydialog("area", myAnswer ^ 2 * pi)
end if
else
display dialog invalid
end if
on error
display dialog invalid
end try
on displaydialog(inputString, theNumber)
display dialog "The " & inputString & " is " & ,
theNumber buttons {"Yeah man"}
end displaydialog
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------