Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Converting Object Heading to Object Text?
Topic Summary:
Created On: 5-Nov-2003 14:29
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 5-Nov-2003 14:29
User is offline View Users Profile Print this message


Mary Miller

Posts: 36
Joined: 12-Sep-2002

Is there a way to convert Object Headings to Object Text via DXL? If so, how would I code it?

Thanks,

Mary
Report this to a Moderator Report this to a Moderator
 5-Nov-2003 14:56
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

See attached

Edited: 5-Nov-2003 at 15:32 by Louie Landale
Report this to a Moderator Report this to a Moderator
 5-Nov-2003 15:43
User is offline View Users Profile Print this message


David Rose

Posts: 80
Joined: 10-Oct-2003

This script will demote a single object. To do it for an entire module you would just add a Module variable and add a "for do" statement

Object o = current
string txt,hdg


txt = probeAttr_(o,"Object Text")
hdg = probeAttr_(o,"Object Heading")
if ((txt == null) && (hdg != null)) {
o."Object Text" = hdg
o."Object Heading" = ""
}


-------------------------
David A. Rose TSgt USAF
NCOIC System Administration
Report this to a Moderator Report this to a Moderator
 5-Nov-2003 15:58
User is offline View Users Profile Print this message


cliff Bly

Posts: 58
Joined: 11-Apr-2003

Using the probeAttr_ function looks good - but this is an undocumented function call and may not be supported in the same way between DOORS versions.

If the function was explained in the DOORS ref manual - I would use it -- however since it is not, I would use Louie's solution.

(If anyone has a complete list of these functions - it would be a nice-to-have reference)

cliff bly
Lockheed Martin Canada

-------------------------
Cliff Bly
Report this to a Moderator Report this to a Moderator
 6-Nov-2003 12:50
User is offline View Users Profile Print this message


Mary Miller

Posts: 36
Joined: 12-Sep-2002

I haven't been able to get either set of scripts to work with what I have so far. I will explain what I am doing in more detail. I am generating a template. When that template is being created, I have a script that inserts an object, and then sets some of the attributes to a specific value.

The inserted object still shows up as a heading instead of an object without any text. What else do I need to fix my script or did I misplace some code?

Here is what I tried with Louie's code:

Object o
Module m = current

void MoveHeadingToText()
{
// Louie's code here.
}

void sectAttr()
{
o = first( m )

for o in m do
{
o = next( o )

if( null o )
{

}
else if( number( o ) "" == "4.1.1." )
{
o = create below( o )

MovingHeadingToText( o )

o."*Object Type" = "Test Description"

}
}
}

sectAttr
Report this to a Moderator Report this to a Moderator
 6-Nov-2003 15:49
User is offline View Users Profile Print this message


Mary Miller

Posts: 36
Joined: 12-Sep-2002

I made a typo when I typed my code. Here it is, but I fleshed out the code this time.

Thanks,

Mary

>>>>>>>>>>>>

Object o
Module m = current

void MoveHeadingToText(Object obj)
{
if( null obj ) return

string Head = richText( obj."Object Heading" )
string Text = richTextWithOle( obj."Object Text" )

if( null Head )
{}
else
{
obj."Object Text" = richText( Head )
obj."Object Heading" = ""
}
}

void sectAttr()
{
o = first( m )

for o in m do
{
o = next( o ) // next object

if( null o )
{

}
else if( number( o ) "" == "4.1.1." )
{
o = create below( o ) // create an object below

MovingHeadingToText( o )

o."*Object Type" = "Test Description" // Set the *Object Type attribute

}
}
}

sectAttr
Report this to a Moderator Report this to a Moderator
 7-Nov-2003 15:54
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

I'd be very interested in how much trouble you get into when you modify the loop variable (o) while inside the loop. I'd also be interested if using the same variable in the create statement causes a problem. I suggest you use variables "oNext" and "oNew"; even if your code DOES work.

Also, your code seems to be moving Heading to Text for a just-created object. Since the heading is null, nothing will happen.

Dare I suggest the following: did you know that an "empty" object (no Heading, Text, Picture (nor OLE in v5)) appears as if it was a Heading in the Hierarchy? e.g. the object created below object 3.1 will be empty, but be number 3.1.1 and appears as if it was a Heading. Only objects containing Text, Picture (or OLE in v5) appear with "0.-" numbers and do NOT show their paragraph number in the Main column. That's an unfortunate lagacy reality of DOORS.

Perhaps what you REALLY want to do is add a space " " to such Object's Text. That will make them look like normal objects in the Main column.

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.