Getting Variables from Option Men --CORRECTION

Charles Szasz cszasz at mac.com
Tue Dec 12 19:43:25 EST 2006


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