Menu parser

FlexibleLearning at aol.com FlexibleLearning at aol.com
Sun Oct 5 02:17:01 EDT 2003


>Does anyone have a function that parses out only the
>active menuitems from a menuList?


Try this :

 put the text of btn "Foo" into tMenuText
 -- strip off the elading tabs for submenus
 replace tab with empty in tMenuText
 -- now filter out the divider lines
 repeat for each line tMenuLine in tMenuText
  if tMenuLine is not among the items of "-,(-"
  then put tMenuLine &return after tStrippedList
 end repeat
 -- finally clean up the trailing return
 delete char -1 of tStrippedList

Then the variable tStrippedList should contain what
you want. I was looking for a way to "filter" instead
of the "repeat" loop but didn't find one right away.


Not exactly, Jan. This retains the non-selectable lines of a menu which need 
to be stripped. I'm having a re-think here.

/H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20031005/40f16da4/attachment.html>


More information about the Use-livecode mailing list