Building a requirement attribute report through DXL
Good Day,
I am running into syntax errors when trying to execute a DXL script in DOORS 9.6.2. The errors are occurring towards the script's end, centered around the If/Else/ElseIf) statements. Here is the script.
// #include <"D:\BM\Rational\DOORS\9.6\Client\include\doors\"stdio.h>
// initalize variables
string NameItem()
string DealWithFormalModule()
string DealWithDescriptiveModule()
string DealWithLinkModule()
void RecurseFolder(Folder fld)
{ // Deal RECURSIVELY with sub-folders, and then all modules in this folder
Skip skpItems = createString()
Item itm
string NameItem
Folder fldNew
// Stage in Skip, key is name which is Alpha order
for itm in fld do
{ put (skpItems, fullName(itm), itm)
}
// Recurse through sub-folders
for itm in skpItems do
{ if (type(itm) == "Folder" or type(itm) == "Project")
{ NameItem = (string key skpItems)
fldNew = folder(NameItem)
RecurseFolder(fldNew) // *** RECURSION ***
}
}
// Now deal with modules in THIS folder
for itm in skpItems do
{ NameItem = (string key skpItems)
if (type(itm) == "Formal") DealWithFormalModule(NameItem)
elseif(type(itm) == "Descriptive") DealWithDescriptiveModule(NameItem)
elseif(type(itm) == "Link") DealWithLinkModule(NameItem)
else{} // Ignore Folder/Project
}
delete(skpItems)
} // end RecurseFolder()
Folder fCurr = current
{ if (!null project(fullName(fCurr)) // Folder IS a project; no need to prompt
RecurseFolder(fCurr)
elseif (confirm("[Confirm] to do current Folder;\n[Cancel] to do current Project"))
RecurseFolder(fCurr)
else RecurseFolder(folder(fullName(getParentProject(fCurr)))
}
Cheers,
KWITS
One answer
Hi,
my name is Sven Schubert, I work for IBM DOORS Support. The following statements are my personal views, they do not necessarily represent IBM's position.
You were missing a few parentheses. Upon inserting them, your code now runs to the point where you'll have to define DealWith... functions, but I suppose that is what you wanted to achieve?
See the correct script below:
my name is Sven Schubert, I work for IBM DOORS Support. The following statements are my personal views, they do not necessarily represent IBM's position.
You were missing a few parentheses. Upon inserting them, your code now runs to the point where you'll have to define DealWith... functions, but I suppose that is what you wanted to achieve?
See the correct script below:
// #include <"D:\BM\Rational\DOORS\9.6\Client\include\doors\"stdio.h>
// initalize variables
string NameItem()
string DealWithFormalModule()
string DealWithDescriptiveModule()
string DealWithLinkModule()
void RecurseFolder(Folder fld)
{ // Deal RECURSIVELY with sub-folders, and then all modules in this folder
Skip skpItems = createString()
Item itm
string NameItem
Folder fldNew
// Stage in Skip, key is name which is Alpha order
for itm in fld do
{ put (skpItems, fullName(itm), itm)
}
// Recurse through sub-folders
for itm in skpItems do
{ if (type(itm) == "Folder" or type(itm) == "Project")
{ NameItem = (string key skpItems)
fldNew = folder(NameItem)
RecurseFolder(fldNew) // *** RECURSION ***
}
}
// Now deal with modules in THIS folder
for itm in skpItems do
{ NameItem = (string key skpItems)
if (type(itm) == "Formal") DealWithFormalModule(NameItem)
elseif(type(itm) == "Descriptive") DealWithDescriptiveModule(NameItem)
elseif(type(itm) == "Link") DealWithLinkModule(NameItem)
else{} // Ignore Folder/Project
}
delete(skpItems)
} // end RecurseFolder()
Folder fCurr = current
{ if (!null project(fullName(fCurr)))
RecurseFolder(fCurr)
elseif (confirm("[Confirm] to do current Folder;\n[Cancel] to do current Project"))
RecurseFolder(fCurr)
else RecurseFolder(folder(fullName(getParentProject(fCurr))))
}