Page 1 of 1
Problem with 'Cancel'
Posted: Tue May 30, 2023 12:47 pm
by CAsba
Hi,
With this code...
Code: Select all
ask "Enter the description of the service."
if the result = "Cancel " then
exit to top
end if
the system just moves on to the next question, disregarding the 'Cancel' input.
The code suggests what I want to happen, but it doesn't.
Any ideas, please ?
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 1:09 pm
by richmond62
No need of "all that":
Code: Select all
on mouseUp
put empty into fld "ff"
ask "Enter the description of the service."
if it is not empty then
put it into fld "ff"
end if
end mouseUp
-
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 1:26 pm
by CAsba
Hi, Many thanks for your kind interest, BUT
I'm afraid it didn't work. The same result as I got before, it just moved to the next question..
Other problem.
I downloaded your attachment. I couldn't run it because there is a problem I have been experiencing for some time, which is, when I click on a file, up comes a box asking what app I want to open it with, and a default "app" which is Livecode 9.69. I am using Livecode v. 10, because I had a problem with v. 9 .69, and I removed the v. 9.69 from the computer and restarted Windows, but still I am unable to open stuff because Windows annoyingly persists in offering a default access route to files with v. 9.69. Any one any ideas how I could possibly resolve this ?
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 1:31 pm
by richmond62
Just don't click on the downloaded file, open it via the OPEN menu item in the LC version of your choice.
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 1:33 pm
by richmond62
it just moved to the next question..
That's because you did NOT tell me there was more than one question.
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 1:36 pm
by richmond62
Have a go with this:
Code: Select all
on mouseUp
put empty into fld "ff"
ask "Enter the description of the service."
if it is empty then
exit to top
else
put it into fld "ff"
end if
ask "Are you Happy now?"
end mouseUp
-
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 1:43 pm
by Klaus
Hi CAsba,
there is a SPACE too much in your script:
Code: Select all
...
ask "Enter the description of the service."
## if the result = "Cancel " then
if the result = "Cancel" then
exit to top
end if
...
Maybe that is the problem?!
Best
Klaus
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 2:25 pm
by dunbarx
Klaus nailed it.
CAsba.
LC looks at the string "Cancel " (what you wrote) as those six characters AND a space. Actually seven characters. You want the exact string "Cancel", six characters. LC simply noticed that the two strings did not match, and went from there.
Craig
Re: Problem with 'Cancel'
Posted: Tue May 30, 2023 4:24 pm
by CAsba
Thanks Klaus ! Well spotted !!