use-revolution Digest, Vol 5, Issue 248

Frank Leahy frank at backtalk.com
Sun Feb 29 19:13:35 EST 2004


On Sunday, February 29, 2004, at 11:23  PM, 
use-revolution-request at lists.runrev.com wrote:

> Subject: Re: The "Answer with dialog"
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Message-ID: <4884CA9C-6B04-11D8-9E0D-0030654C1E62 at realtorsgroup.us>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Ok got that , now to trap the yes or whatever , I tried
> if it is "a" , didn't work out.
> also tried put it into it and then if it is "a" also not
> thanks hershrev.
>

Hershrev,

Do you know how to use the debugger?  If not it's really worth figuring 
out how to use it, because you could have answered your own question 
without having to wait for a reply email.

If you have this code in a button's script:

on mouseUp
    answer "Do you want to save?" with "No" or "Yes"
end mouseUp

Set a breakpoint on the "answer" line, close the script, then click the 
button.  When the debugger comes up, click "step over" -- the answer 
dialog will come up and you'll select either "Yes" or "No".  You'll now 
be back in the debugger on the "end mouseUp" line.  Now open the 
"Variable Watcher" window.  You'll see that the variable "it" has the 
name of the button you clicked.

Click Abort or Run to get out of the debugger, then edit your script 
like this:

on mouseUp
    answer "Do you want to save?" with "No" or "Yes"
    if it is "Yes" then
      ... do save...
    end if
end mouseUp

Hope this helps.

-- Frank



More information about the use-livecode mailing list