re switch

Stephen Messimer steve at messimercomputing.com
Tue Jan 13 10:18:52 EST 2004


On Tuesday, January 13, 2004, at 07:58 AM, 
use-revolution-request at lists.runrev.com wrote:

Francois,

Try this:

on mouseup
   put word 2 of the selectedline of me into nbcalc

-- lets say this fld has two lines with a string on each line. Line one 
contains the string " Color red" and line two contains the string 
'Color Blue"

   switch nbcalc
	case "red" -- this is the string in line one the fld referenced above
     		put 0 into fld "nbcalc"
     		break	
  	case  "blue" -- this is the string in line two of the fld referenced 
above
		put 2 into fld "nbcalc"
		break
   end switch

end mouseup


> Hello everybody!
> I have a problem with the "Switch" command.
> Here is my little Code:
>
> on mouseup
>   put word 2 of the selectedline of me into nbcalc
>
>   switch nbcalc
>
>   case 1
>     put 0 into fld "nbcalc"
>
>   case 2
>
>     put 2 into fld "nbcalc"
>   end switch
>
> end mouseup
>
> It's always the case 2 that's done, even if the nbcalc is 1!
> What's wrong please?
>
>
> Amicalement
> François
>

Stephen R. Messimer, PA
208 1st Ave. South	
Escanaba, MI 49829
http://www.messimercomputing.com
--
Build Computer-Based Training modules FAST with preceptorTools™ -- 
version 1.0.3 available Now!
--
Macintosh G-4 OSX 10.2.6, OS 9.2.2, 512MB RAM, Rev 2.1.2



More information about the use-livecode mailing list