Capture the Trig Function from an Option Menu Button

Roger Guay irog at mac.com
Fri Dec 7 17:02:57 EST 2012


Thanks for your help, Paul. Your second script is more like what I need. BUT, I need to capture the bare function to be used with angles that are derived from some other script. Something like:

local  theTrigFctn

on thisHandler
 put the label of btn "myOptiionMenu" into tOption
 switch tOption
     case "sin"
        put sin into theTrigFctn  --- you can't do this
        break
     case "cos"
        put cos into theTrigFctn  --- you can't do this
        break
     case "tan"
        put tan into theTrigFctn  --- you can't do this
        break
  end switch
end thisHandler

on otherHandler theta
    put theTrigFctn(theta)
end otherHandler

Thanks again,
Roger




On Dec 7, 2012, at 12:55 PM, Paul Hibbert <lc at pbh.on-rev.com> wrote:

> command thisHandler
>  put the label of btn "myOptiionMenu" into tOption
>  switch tOption
>      case "sin"
>         put the sin of fld 1 into fld 2
>         break
>      case "cos"
>         put the cos of fld 1 into fld 2
>         break
>      case "tan"
>         put the tan of fld 1 into fld 2
>         break
>   end switch
> end thisHandler





More information about the use-livecode mailing list