SPONSORS:






User Tag List

Results 1 to 3 of 3

Thread: Recursive menus

  1. #1
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recursive menus

    The app I am testing has multiple
    recursive menus. I am using a recursive
    function to walk through the apps menus. However, when my function encounters one of the recursive menus, obviously, it gets
    stuck in a loop. A (long...sorry!) example of the recursive menu structure is shown below:

    Vendor (Menu)
    Item A (MenuItem)
    Item B (MenuItem)
    Item C (MenuItem)
    PO Reports (Menu)
    Item D (MenuItem)
    Item E (MenuItem)
    Item F (MenuItem)
    EDI Reports (Menu)
    Item G (MenuItem)
    Item H (MenuItem)
    Item I (MenuItem)
    Purchasing Reports (Menu)
    Item D (MenuItem)
    Item E (MenuItem)
    Item F (MenuItem)
    EDI Reports (Menu)
    Item G (MenuItem)
    Item H (MenuItem)
    Item I (MenuItem)
    Purchasing Reports (Menu)
    Item D (MenuItem)
    Item E (MenuItem)
    Item F (MenuItem)

    You can see that the first occurence of the
    "Purchasing Reports" menu is where the recursion
    starts.

    I originally tried keeping track of each menu and menuitem in a list.
    Every time a new menu or menuitem was to be selected, it
    would first search the list to find if it already existed. If it did, it would
    break out of that recursion layer and continue. However, from the example above,
    you can see that the loop would not be broken until the second "EDI Reports"
    menu was reached. This results in duplicated testing efforts (Items, D,E & F).

    My next idea is to keep track of a menus children in a list.
    For example, when I select the initial "Vendor" menu, I write
    all of its children (Items A,B,C) to List1. Then for each succesive menu,
    I write the children to a new list and compare each list. If the new list matches
    an existing one, it can be assumed to be a recursive menu.

    Does this sound like a reasonable solution? Has anyone
    had any experience with this problem before?

    Thanks!!

    Damian Synadinos
    QA Engineer
    Symix Computer Systems



  2. #2
    Junior Member
    Join Date
    Jul 1999
    Location
    Austin, TX
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recursive menus

    Not sure I understand what the problem is ... that you run into an endless recursion when the menus turn recursive? That's easy to fix, just don't key off the menu tags/caption, use the object reference instead (which you get from e.g. GetChildren ()).

    : - )
    Stephan

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Columbus, OH, USA
    Posts
    689
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recursive menus

    For those interested...
    I ended up taking "snapshots" of each
    submenu (before selecting it) and comparing
    the snapshot to all other previous menu snapshots. If the current snapshot matched
    a previous one, it must be a recursive menu, so skip it and continue. Else, select it
    and continue!


 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:38 AM.

Copyright BetaSoft Inc.