Hi everyone,
I am very new to Revolution and am bashing my head against the wall with the "answer" command. The pseudo code that I want to have is as follows:
if (answer "Is this OK?" with "Yes" or "No") = "Yes" then
(do "Yes" code)
else
(do "No" code)
end if
I tried with variables, I tried all sorts of things. The documentation does not make it clear what happens here and I can't readily find any sample scripts written by others. How does answer give feedback on which button was pushed? And how can I use that in my IF statement?
Thanks for your help!
"answer" command code samples?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Back when Jeanne DeVoto was working on the docs they had more end-to-end examples. Now they usually show only the one line with the token being discussed, without any context to show how it's used. In short, I feel your pain. 
The trick with the answer command is it. I mean literally, "it", a local variable used for all sorts of things in RevTalk, including for replies to the answer, ask, answer file, ask file and other commands:

The trick with the answer command is it. I mean literally, "it", a local variable used for all sorts of things in RevTalk, including for replies to the answer, ask, answer file, ask file and other commands:
Code: Select all
answer "Is this OK?" with "Yes" or "No"
If it is "No" then
answer "Whinger!"
else
DoSomethingMoreInteresting
end if
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 5
- Joined: Wed Oct 21, 2009 3:53 am
Thanks
Thanks, that did the trick! I am sure I will have quite a few more questions in the days to come... 
