dumb question... get value of option button

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
shawn
Posts: 18
Joined: Sat Jan 02, 2010 4:11 am

dumb question... get value of option button

Post by shawn » Tue Mar 23, 2010 5:00 pm

Dumb question I am sure but after searching for awhile I still haven't found the answer....

How do I get the selected value of an option button?

I have code in so when the button is changed by the user I get what they selected but I can't find how to simply read the selected value. I need this at startup.

Get returns all the possible choices in the option button, not the one selected by the user.

Thanks,

Shawn

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: dumb question... get value of option button

Post by bn » Tue Mar 23, 2010 5:31 pm

Hi Shawn,
look at menuHistory in the dictionary,
it gives you an integer of the selected menuoption, with the text of button "myOptionButton" you get a list of the available options.

Code: Select all

on mouseUp
   put the menuhistory of btn 1 into tHist
   put the text of btn 1 into tText
   put line tHist of tText
end mouseUp
regards
Bernd

shawn
Posts: 18
Joined: Sat Jan 02, 2010 4:11 am

Re: dumb question... get value of option button

Post by shawn » Tue Mar 23, 2010 6:57 pm

Hi Bernd,

Thank you very much. That took care of it.

Shawn

Post Reply