Topic
  • 2 replies
  • Latest Post - ‏2014-04-14T10:59:19Z by MyDeveloerWorks
MyDeveloerWorks
MyDeveloerWorks
41 Posts

Pinned topic Navigating Explorer and processing inside Module

‏2014-04-07T12:48:08Z |

Hello Dxl Community

How can I fix the module level processing section of this code below so that it works. The code below is really just "boiler plate code" for  navigating at DOORS explorer level in a given Folder and extracting attributes from all the modules (..for later processing, export) etc.

This code would have to be execute in the Explorer context (Tools->Edit Dxl)

How does one add a DXL program on the menu at DOORS explorer level?

 
void goRecurse(Folder thisFold) {
    Item itm
    for itm in all thisFold do {
        if (type(itm) == "Folder" or type(itm) == "Project") {
            goRecurse(folder(itm)) // if it's a 'folder' keep digging
        }
        else if (type(itm) == "Formal") 
        {
/////
//BEGIN MODULE processing section
 
Object o
string hdg, txt
 
    for o in itm do  // or is it : for o in Current Module???
          {
 
    print identifier(o) 
      print txt "\n"
   
          }  
/////
//END MODULE processing section
        }
    }
}
 
 
goRecurse(current Folder) // start at the current folder
  • llandale
    llandale
    3035 Posts

    Re: Navigating Explorer and processing inside Module

    ‏2014-04-07T17:36:36Z  

    You need to open the module

    • Module mod = read(fullName(itm), false, true)
    • for o in mod do
    • {  print (identifier(o)) "\t" (o."Object Text") "\n"
    • }
    • close(mod)

    -Louie

    I prefer this construct:

    • for itm in thisFold do  if "formal" deal with module
    • for itm in thisFold do if "Folder" or "Project" then recurse it
  • MyDeveloerWorks
    MyDeveloerWorks
    41 Posts

    Re: Navigating Explorer and processing inside Module

    ‏2014-04-14T10:59:19Z  
    • llandale
    • ‏2014-04-07T17:36:36Z

    You need to open the module

    • Module mod = read(fullName(itm), false, true)
    • for o in mod do
    • {  print (identifier(o)) "\t" (o."Object Text") "\n"
    • }
    • close(mod)

    -Louie

    I prefer this construct:

    • for itm in thisFold do  if "formal" deal with module
    • for itm in thisFold do if "Folder" or "Project" then recurse it

    thanks that worked!