Page 1 of 1

Option Menu Button value

Posted: Tue Dec 17, 2013 11:43 pm
by palanolho
Greetings everyone.

I'm having some trouble with Option Menu bottons...

I know how to get the current index of the selected options of an option menu (using the menuHistory)

However,

- How do I get the value of the current selected item OR the value corresponding to index N?
- How can can I get the index of option "ABC"


Thanks in advance for any help.

- Miguel Pinto

Re: Option Menu Button value

Posted: Tue Dec 17, 2013 11:50 pm
by Klaus
Hola Miguel,

what do you mean by "index" of an option button?
You can query the current LABEL of that button if that is what you mean?


Best

Klaus

Re: Option Menu Button value

Posted: Wed Dec 18, 2013 2:42 pm
by palanolho
The menuHistory of a button returns the index of the selected option, correct?

So, I would like to be able to get the value of the button given the index or vice versa

Re: Option Menu Button value

Posted: Wed Dec 18, 2013 4:19 pm
by Klaus
Hola Miguel,
palanolho wrote:The menuHistory of a button returns the index of the selected option, correct?
ah, yes, sure!
palanolho wrote:So, I would like to be able to get the value of the button given the index or vice versa
OK, just check "the text of btn xyz" = its menuitems!

With a number (menuhistory) in a variable named "tMenuH":
...
put the text of btn "your option button here" into tOptions
answer line tMenuH of tOptions
...
With a menuitem:
...
## We use LINEOFFSET
put the text of btn "your option button here" into tOptions
set the wholematches to TRUE
answer lineoffset("name of menu item",tOptions)
...

Best

Klaus