Insert text into column/row

hi,

i want to insert a string(text) into a column of a module.

I know how to insert a attribute but i want to insert a text...

Maybe something like text(Column, String) and not attribute(Column, Attr)

Module m = current 
Column c
int i = 0 
Object o 
load view "viv" 
string x

for o in m do
{
        print "____________________\n"
        for c in m do
        {
                print "<" (title c) "> \t"
                if(main c)
                {
                        print "-"o."Object Heading" "\n"
                        
                }
                else
                {
                        print "-" (text(c, o) ) "-\n"
                        x = text(c,o)
                } 
        }
        i++
}

print i "\n\n"

//ADD A NEW COLUMN IN A NEW VIEW
c = insert column i 
attribute(c, "Created By") 
width(c, 150)
title(c, "Test")

refreshExplorer current Module
View vi = view "viv"
save vi 

 

And the other problem is that i have to leave the module open or i get "wrong" values

module open > x = Admin

module close > x = 3

 


meinhana - Thu Feb 04 04:36:32 EST 2016

Re: Insert text into column
morast - Thu Feb 04 05:12:07 EST 2016

I think you are looking for Layout DXL. Have a look in the DXL manual.

 

Here's a tiny example:

 

Module m = current
Column c = insert column(0)
dxl(c, "display \"Layout DXL\"") 
title(c, "Test Layout DXL")
width(c, 100)

 

Re: Insert text into column
meinhana - Thu Feb 04 05:33:28 EST 2016

morast - Thu Feb 04 05:12:07 EST 2016

I think you are looking for Layout DXL. Have a look in the DXL manual.

 

Here's a tiny example:

 

Module m = current
Column c = insert column(0)
dxl(c, "display \"Layout DXL\"") 
title(c, "Test Layout DXL")
width(c, 100)

 

I found : dxl(column 0, "display obj.\"Object Heading\"")

And how do i add a string into the code?

i try this dxl(c, "display \" x "\")

"x" is a string

But this don't work

 

Re: Insert text into column
morast - Thu Feb 04 05:50:15 EST 2016

meinhana - Thu Feb 04 05:33:28 EST 2016

I found : dxl(column 0, "display obj.\"Object Heading\"")

And how do i add a string into the code?

i try this dxl(c, "display \" x "\")

"x" is a string

But this don't work

 

Module m = current
Column c = insert column(0)
string x = "My Layout DXL string"
dxl(c, "display\"" x "\"") 
title(c, "Test Layout DXL")
width(c, 100)

 

Re: Insert text into column
meinhana - Thu Feb 04 05:53:17 EST 2016

morast - Thu Feb 04 05:50:15 EST 2016

Module m = current
Column c = insert column(0)
string x = "My Layout DXL string"
dxl(c, "display\"" x "\"") 
title(c, "Test Layout DXL")
width(c, 100)

 

Thank you !
 

Re: Insert text into column
meinhana - Mon Feb 08 04:04:44 EST 2016

Why did he write into all rows?

How can i say -> Write in this row(if link exists) of the column(i(last column+1))

I try to do this

Module m = current 
Column c
Object o 
LinkRef lr

for c in m do
{
        i++
}
i = i+1 
c = insert column i 
title(c, "Link")
width(c, 100) 

for o in m do
{
    for lr in all (o<-"*") do 
    {
        print "<In Link>\t"
        ModuleVersion mvSource = sourceVersion lr
        mvSName = fullName(mvSource) 
        //print o."Object Heading" "\t"
        print "-"mvSName "\n"
        dxl(c, "display\"In Link-" mvSName "\"")  
        delete mvSource
    }  
}

 

Re: Insert text into column
morast - Mon Feb 08 06:46:55 EST 2016

meinhana - Mon Feb 08 04:04:44 EST 2016

Why did he write into all rows?

How can i say -> Write in this row(if link exists) of the column(i(last column+1))

I try to do this

Module m = current 
Column c
Object o 
LinkRef lr

for c in m do
{
        i++
}
i = i+1 
c = insert column i 
title(c, "Link")
width(c, 100) 

for o in m do
{
    for lr in all (o<-"*") do 
    {
        print "<In Link>\t"
        ModuleVersion mvSource = sourceVersion lr
        mvSName = fullName(mvSource) 
        //print o."Object Heading" "\t"
        print "-"mvSName "\n"
        dxl(c, "display\"In Link-" mvSName "\"")  
        delete mvSource
    }  
}

 

You got it all wrong. 

Quote from DXL Help file: 
"Layout DXL programs run in a context where the variable obj is pre-declared. You can have a column that contains DXL code. The code calculates the value to display for each object. The current object to calculate is referred to as obj"

So, the DXL code is "genereic" for the column, but it executes for each object and in the context of each object. I modify my trivial example a little to illustrate it better: 

Module m = current
Column c = insert column(0)
string x = "My Layout DXL string"
string myLayoutDXL = "display identifier obj"
dxl(c, myLayoutDXL) 
title(c, "Test Layout DXL")
width(c, 100)

If you need multiple lines of layout DXL code it could be more practical to use an include file or else read the code from an external file.

 

Re: Insert text into column
meinhana - Mon Feb 08 07:17:24 EST 2016

morast - Mon Feb 08 06:46:55 EST 2016

You got it all wrong. 

Quote from DXL Help file: 
"Layout DXL programs run in a context where the variable obj is pre-declared. You can have a column that contains DXL code. The code calculates the value to display for each object. The current object to calculate is referred to as obj"

So, the DXL code is "genereic" for the column, but it executes for each object and in the context of each object. I modify my trivial example a little to illustrate it better: 

Module m = current
Column c = insert column(0)
string x = "My Layout DXL string"
string myLayoutDXL = "display identifier obj"
dxl(c, myLayoutDXL) 
title(c, "Test Layout DXL")
width(c, 100)

If you need multiple lines of layout DXL code it could be more practical to use an include file or else read the code from an external file.

 

Ok, well that is an good answer, so dxl() write into the column c (in all rows of the column)  the identifier obj...

and my other question ("How can i say -> Write in this row of the column") ?

I just want to look in my formal module, find the object with an link and display the "fullName" of the link into the row/column of the end of the table .... 

 

 

Re: Insert text into column
morast - Mon Feb 08 07:25:07 EST 2016

meinhana - Mon Feb 08 07:17:24 EST 2016

Ok, well that is an good answer, so dxl() write into the column c (in all rows of the column)  the identifier obj...

and my other question ("How can i say -> Write in this row of the column") ?

I just want to look in my formal module, find the object with an link and display the "fullName" of the link into the row/column of the end of the table .... 

 

 

Take my little example and replace myLayoutDXL with the code of your choice.

By using the predefined obj variable you can control what to be displayed in each "row" of the column as illustrated by "display identifier obj"

Re: Insert text into column
meinhana - Mon Feb 08 07:49:07 EST 2016

morast - Mon Feb 08 07:25:07 EST 2016

Take my little example and replace myLayoutDXL with the code of your choice.

By using the predefined obj variable you can control what to be displayed in each "row" of the column as illustrated by "display identifier obj"

No, maybe you don't understand what i want to do?

I don't want to display the "obj."Object Heading"" or "obj."Created By"" values, i have understood that "myLayoutDXL" is dxl code, 

again.... i have a module

ID Title
1 Test           (link no)
2 Test2        (link yes)

searching links.... oh there is a link, ok put the "fullName" behind it :)

ID Title Link
1 Test  -
2 Test2 Project/Test/Module/something

 

Did you now understand me? Well, sorry, my English is not so good, i can't explain this,

Please look at my code, everything i just need is a method like "insert/display(Object?Row?, Column, String)  ...

Re: Insert text into column
morast - Mon Feb 08 08:52:14 EST 2016

meinhana - Mon Feb 08 07:49:07 EST 2016

No, maybe you don't understand what i want to do?

I don't want to display the "obj."Object Heading"" or "obj."Created By"" values, i have understood that "myLayoutDXL" is dxl code, 

again.... i have a module

ID Title
1 Test           (link no)
2 Test2        (link yes)

searching links.... oh there is a link, ok put the "fullName" behind it :)

ID Title Link
1 Test  -
2 Test2 Project/Test/Module/something

 

Did you now understand me? Well, sorry, my English is not so good, i can't explain this,

Please look at my code, everything i just need is a method like "insert/display(Object?Row?, Column, String)  ...

I'm not sure I'm the one not understanding :-)

There is no such method "insert/display(Object?Row?, Column, String)  ...  DOORS does not work that way. 

However with layout DXL you can accomplish what you want. 

Let's take you one step further, as I suggested by modifying the MyLayoutDXL code.

But at some point, for the final solution you have to do some work by yourself. Over and out.

 

Module m = current
Column c = insert column(0)
// Please note necessary \n and \" in string variable myLayoutDXL
string myLayoutDXL = "LinkRef lr \n for lr in obj <- \"*\" do display fullName(sourceVersion lr)"
dxl(c, myLayoutDXL) 
title(c, "Test Layout DXL")
width(c, 100)

 

Re: Insert text into column
meinhana - Mon Feb 08 08:56:52 EST 2016

morast - Mon Feb 08 08:52:14 EST 2016

I'm not sure I'm the one not understanding :-)

There is no such method "insert/display(Object?Row?, Column, String)  ...  DOORS does not work that way. 

However with layout DXL you can accomplish what you want. 

Let's take you one step further, as I suggested by modifying the MyLayoutDXL code.

But at some point, for the final solution you have to do some work by yourself. Over and out.

 

Module m = current
Column c = insert column(0)
// Please note necessary \n and \" in string variable myLayoutDXL
string myLayoutDXL = "LinkRef lr \n for lr in obj <- \"*\" do display fullName(sourceVersion lr)"
dxl(c, myLayoutDXL) 
title(c, "Test Layout DXL")
width(c, 100)

 

I laugh so hard right now :D

Thank you very very much