Re: I don't understand the SWITCH command Š

Klaus Major klaus at major-k.de
Tue Jan 13 08:17:29 EST 2004


Bon jour François,

> Hello everybody!
> I have a problem with the "Switch" command.
> Here is my little Code:

You forgot to add the "break" after each "case":

> on mouseup
>   put word 2 of the selectedline of me into nbcalc
>
>   switch nbcalc
>
>   case 1
>     put 0 into fld "nbcalc"
        break
>   case 2
>     put 2 into fld "nbcalc"
        break
>   end switch
> end mouseup
>
> It's always the case 2 that's done, even if the nbcalc is 1!
> What's wrong please?

The engine does not "break" after checking the first "case" :-)

Hope that helps.

> Amicalement
> François

Au revoir

Klaus Major
klaus at major-k.de
www.major-k.de



More information about the use-livecode mailing list