Main menu puzzle

Klaus Major klaus at major-k.de
Sat Feb 18 08:13:19 EST 2006


Hi Ken,

> Alex
> You say:
> on menuPick pWhich
>     switch pWhich
>         case "Exit"
>             answer "Are you sure you want to exit?" with "Yes" or "OK"
>             if it is "OK" then quit
>             break
>     ...
> I'm sure this would work.  Problem is, I don't understand why.   
> This isn't
> your problem, you've given me a solution which is more than I could  
> expect,
> thank you.
>
> My problem with this script is:  it produces two choices, Yes or  
> No. Buttons
> I assume.  OK is handled.  Yes does not appear to be handled by  
> anything.
> But, if it works it must be handled somehow.  But there is nothing  
> in this
> script (that I can see) to cater for a choice of Yes.

See below, i am sure it should read "NO" instead of "YES"

> It's a dilemma.  You say this works. I believe you (on faith, not  
> having
> tried it). But I can't see how it can possibly work, because there is
> nothing that appears to handle a choice of Yes.  Isn't programming  
> supposed
> to follow the script?
>
> Or... is there some mystical dimension to these scripts... some  
> sort of
> default skypilot script or command that takes care of these messy  
> details?
> If so, does one have to enter an order for the secret to be revealed?

I think Alex meant this one:

> on menuPick pWhich
>     switch pWhich
>         case "Exit"
             answer "Are you sure you want to exit?" with "NO" or "OK"
## OK and YES are synonyms and that would not make sense here :-)

>             if it is "OK" then quit
>             break
>         case "Quit"
>            answer ....
>            if it is "OK" then ...
>            break
>     end switch
> end menuPick


>
> Regards
> ken

Best

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list