menuItem and menuHistory Question

Ken Ray kray at sonsothunder.com
Tue Sep 20 13:35:24 EDT 2005


On 9/20/05 11:26 AM, "Klaus Major" <klaus at major-k.de> wrote:

> Hi David,
> 
>> Hi All,
>> 
>> If I have the name of a Menu Item (In a Tabbled Button) "OptionA",
>> how can I get the Item Number associated with it. I want to set the
>> menuHistory property to the Item Index of Item "OptionA". I just
>> can't seem to work out how to do it!
> 
> ...
>   put lineoffset("OptionA", btn "my TAB button") into my_menuhistory

Just a quick comment on this - this only works if you don't have
similarly-named items in the menu (such as looking for "Save" in a menu that
has both "Save" and "Save as...").

So you either need to 'set the wholeMatches to true' before you do your
'lineOffset', or you an do this:

  put lineOffset(cr & "OptionA" & cr, cr & btn "my TAB button" & cr) into \
      my_menuhistory


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list