Capture the Trig Function from an Option Menu Button
Jim Hurley
jhurley0305 at sbcglobal.net
Sat Dec 8 13:11:31 EST 2012
Hi Roger
I'm sure I missed the point of this thread. I'll go through it more carefully.
But could you tell me how this "mouseUP" handle fails to do the job?
Thanks,
Jim
on mouseUp
put field 1 into tAngle
put tAngle*pi/180 into tAngle
--put the label of btn "myOptiionMenu" into sOption
put the label of button "myOptionMenu" into tTrigFunct
switch tTrigFunct
case "sine"
put sin(tAngle) into tValue
put "The sine of " & tAngle*180/pi & " degrees is " & tValue into tResult
break
case "cosine"
put cos(tAngle) into tValue
put "The cosine of " & tAngle*180/pi & " is " & tValue into tResult
break
case "tangent"
put tan(tAngle) into tValue
put "The Tangent of " & tAngle*180/pi & " is " & tValue into tResult
end switch
put tResult into field 2
end mouseUp
>
> Message: 5
> Date: Fri, 07 Dec 2012 12:10:28 -0800
> From: Roger Guay <irog at mac.com>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Subject: Capture the Trig Function from an Option Menu Button
> Message-ID: <720DB527-9FF1-4754-89C1-CE08D44B01A4 at mac.com>
> Content-Type: text/plain; CHARSET=US-ASCII
>
> I know this is probably a stupid question, but I can't seem to make it work:
>
> I have an Option Menu button with sin, cos, tan as menu Items. I want my card script to take the label of that button, and then perform the trig function with that label. I've tried every thing I can think of to "get", "do" or in general assemble the script, but to no avail. Any suggestion?
>
> TIA,
> Roger
>
>
More information about the use-livecode
mailing list