Question

Why does this cancel check not work?

answer file "Bitte Bild auswählen" with type "Images|jpg|jpeg|png" if the result is not "cancel" then put it into tMyImagePath ... end if

It always starts to run code. I also tried "Cancel" and "Abbrechen". I am using MacOSX in German and LiveCode 6.6.2 RC3.

Was it helpful?

Solution

Just replace "the result" with "it" and it should work.

The user response of an answer dialog is stored in the variable "it".

Btw, pressing "cancel" in an "answer file" dialog does return nothing to the variable "it"

So you could change your script like this

answer file "Bitte Bild auswählen" with type "Images|jpg|jpeg|png" 
if it is not empty then put it into tMyImagePath
...
end if

OTHER TIPS

If you want to use 'the result' you can also do this:

answer file "Bitte Bild auswählen" with type "Images|jpg|jpeg|png" 
if the result is not empty then 
  put it into tMyImagePath
  ...
end if
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top