Page 1 of 1

Having a problem with the "ask" dialog

Posted: Fri Apr 20, 2007 1:51 am
by stuartls
Here is my code.

on mouseUp
ask "Enter the Question # you would like to go to! Then press the OK button"
if it is not a number or it > 200 or it = 0
then answer "Your input must be a number and must be between 1 and 200!"
else go to card it
end mouseUp

Butttttttt when a person hits the cancel button there is displayed "Your input must be a number and must be between 1 and 200!"

What am I doing wrong and is there a better code?

Thanks!
Stu

Posted: Fri Apr 20, 2007 8:24 am
by Mark
Hi Stu,

It should be:

Code: Select all

on mouseUp
  ask "Enter the Question # you would like to go to! Then press the OK button"
  if it is empty then
    exit mouseUp
  else if it is not a number or it > 200 or it = 0 then
    answer "Your input must be a number and must be between 1 and 200!"
  else go to card it
end mouseUp
Best,

Mark