Getting Variables from Option Men --CORRECTION

Mark Schonewille m.schonewille at economy-x-talk.com
Wed Dec 13 04:10:21 EST 2006


Charles,

Why variables?

on mouseUp
   if the label of btn 1 is a number and ¬
   the label of btn 2 is a number then
     put the label of btn 2 - the label of btn 1 into x
     -- do something with x
   end if
end mouseUp

No need for a script in the option menu buttons.

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Get your store on-line within minutes with Salery Web Store software.  
Download at http://www.salery.biz

Op 13-dec-2006, om 1:43 heeft Charles Szasz het volgende geschreven:

>
> I have set up two option menus. Each has a script that puts the  
> label value into a variable:
>
> ON menuPick theItem
>   IF theitem is "2006" THEN
>     put "2006" into eYr
>   ELSE IF theitem is "2007" THEN
>     put "2007" into eYr
>   ELSE IF theitem is "2008" THEN
>     put "2008" into eYr
>   ELSE IF theitem is "2009" THEN
>     put "2009" into eYr
>   ELSE IF theitem is "2010" THEN
>     put "2010" into eYr
>   END IF
> END menuPick
>
> The other Option Menu has the following script:
> on menuPick theItem
>   if theitem is "2002" then
>     put "2002" into bYr
>   else if theitem is "2001" then
>     put "2001" into bYr
>   else if theitem is "2000" then
>     put "2000" into bYr
>   else if theitem is "1999" then
>     put "1999" into bYr
>   else if theitem is "1998" then
>     put "1998" into bYr
>   END IF
> END menuPick
>
>
> In a button I have the following script:
>
> ON mouseUp
>     put (eYr - bYr) into fld "yrFld"
> END mouseUp
>
> I keep getting an error message that there is a problem with the  
> left operant. I ran the debugger and found that neither variable,  
> eYr or bYr had a value. What is wrong with this script?
>
>
> Charles Szasz
> cszasz at mac.com
>




More information about the use-livecode mailing list