Format Attributes in Link Analysis Wizard using DXL

I have been using the code below for a while and it works great as is, but I need it to do something more. The current code has been modified from the auto-generated Analysis Wizard code (see where is says: "//Test attribute information"). This block of code pulls the attribute value(s) from the "Tests" attribute in child modules and puts it  in the Analysis Wizard output in my top level module. As said before, this code works great so far. 

Here is where I need help:

The "Tests" attribute in the child module is a multi-valued attribute. When I select more than one value and have the code roll-up the values in the Analysis Wizard there is a carriage return between each of the multi-valued attribute values. Is there a way to change this so that instead of a carriage return I get a space or a comma? 

 

// DXL generated by DOORS traceability wizard on 10 May 2016.

// Wizard version 2.0, DOORS version 9.6.0.0
pragma runLim, 0
int lines[4] = {0, 0, 0, 0}
void adjustLines(int depth, showAtDepth) {
    int count
    for (count = 0; count < 4; count++) {
        while (lines[depth-1] < lines[count]) {
            if (depth == showAtDepth) displayRich("\\pard " " ")
            lines[depth-1]++
        }
    }
}
void showIn(Object o, int depth) {
    Link l
    LinkRef lr
    ModName_ otherMod = null
    Module linkMod = null
    ModuleVersion otherVersion = null
    Object othero
    string disp = null
    string s = null
    string plain, plainDisp
    int plainTextLen
    int count
    bool doneOne = false
    string linkModName = "*"
    for lr in all(o<-linkModName) do {
        otherMod = module (sourceVersion lr)
        if (!null otherMod) {
            if ((!isDeleted otherMod) && (null data(sourceVersion lr))) {
                load((sourceVersion lr),false)
            }
        }
    }
    for l in all(o<-linkModName) do {
        otherVersion = sourceVersion l
        otherMod = module(otherVersion)
        if (null otherMod || isDeleted otherMod) continue
        othero = source l
        if (null othero) {
            load(otherVersion,false)
        }
        othero = source l
        if (null othero) continue
        if (isDeleted othero) continue
        adjustLines(depth, 2)
        if (depth < 4) {
            showIn(othero, depth+1)
        }
        doneOne = true
        if (depth == 2) {
            disp = ""
            s = name(otherMod)
            if (isBaseline(otherVersion)) {
                s = s " [" versionString(otherVersion) "]"
            }
            s = "Module Name:" s
            disp = disp s
            s = (identifier othero)
            s = "Object Identifier:" s
            disp = disp  " " s
            s = probeRichAttr_(othero,"Object Heading", false)
            s = "Object Heading:" s
            disp = disp  " " s
            s = probeRichAttr_(othero,"Object Text", false)
            s = "Object Text:" s
            disp = disp  " " s
                        
                        //Data State attribute information
                        s = probeAttr_(othero, "Data State")
                        s = "Data State:" s 
                        disp = disp " " s
                        //Test attribute information
                        s = probeAttr_(othero, "Tests")
                        s = "Tests:" s 
                        disp = disp " " s
                        
                        //External Link attribute information
                        s = probeAttr_(othero, "DXL for Name")
                        s = "" s 
                        disp = disp " " s
                        s = probeAttr_(othero, "DXL for Link Path")
                        s="" s
                        disp=disp " " s
                        
            displayRich("\\pard " disp)
        }
        lines[depth-1]++
    }
}
showIn(obj,1)

Thanks for the help!


MacCleirich - Thu Jul 28 20:59:50 EDT 2016

Re: Format Attributes in Link Analysis Wizard using DXL
DOORSHAM - Fri Jul 29 04:06:43 EDT 2016

You have to build your own replace function.  There are many proto types listed in the forum and in the help files.  Here is one I found with a quick search that may get you started:

 

https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014626157&ps=25