Page 1 of 1

Ask - cancel gives empty field

Posted: Mon Jul 23, 2007 2:57 pm
by Andycal
This is probably RunRev 101 stuff, but I'm having a problem getting my head around the syntax, so here goes:

I've got this code on a button:

on mouseUp
ask question "Please enter the ftp site address" with field "ftpField"
put it into field "ftpField"
end mouseUp

However, if I press 'cancel' the field is emptied, but I want it to stay as it was, i.e. no change.

How's this done?

Posted: Mon Jul 23, 2007 3:02 pm
by Andycal
I fixed it!

Code: Select all

on mouseUp
  ask question "Please enter the ftp site address" with field "ftpField" titled "Enter FTP site details"
  if it is empty then
    exit mouseUp
  else
    put it into field "ftpField"
    end if
end mouseUp

Posted: Mon Jul 23, 2007 6:28 pm
by Klaus
Exactly :-)


Best

Klaus