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: generate a new module using existing object headings
Topic Summary:
Created On: 9-Jan-2006 12:37
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.
Answer This question was answered by cliff Bly, on Tuesday, January 10, 2006 8:29 AM

Answer:
Oh -- then the line that has "ob = create(newModule)" will ALWAYS create a level 1 object at the beginning of the module. Hence the wrong order. You will need something like.
 9-Jan-2006 12:37
User is offline View Users Profile Print this message


martin allman

Posts: 74
Joined: 25-Jul-2005

Creating a new Module

 fficeffice" />>>

I have a open module with object headings as follows

 >>

1   Title

1.1  subheading1

1.2  subheading2

1.3  subheading3

 >>

I would like to run a piece of dxl code from this module that generates the level 1 and level 2 headings in a new module(I have to do it this way).  This is the code that I have generated so far.  It generates a new module but imports the headings as follows ie in reverse order and all as level one objects.  I want to preserve the original order and level one and two headings grateful for any advice on this.

 >>

1    subheading3

2        subheading2

3        subheading1

4        Title

 >>

 >>

//creating a new module using headings from a existing module>>

Object obj, ob>>

testmodname = "/Play area/newfile">>

Module curMod = current>>

Module newModule>>

 >>

 >>

if( exists  module testmodname)>>

       {>>

       newModule = edit (testmodname,true)>>

       }>>

else>>

       {>>

       newModule = create(testmodname,"Test Case","",1)>>

       newModule = edit (testmodname,true)>>

       >>

       }>>

current  = curMod>>

 >>

for obj in curMod do>>

{>>

       string holder = probeAttr_(obj,"Object Heading")>>

       ob = create(newModule)          >>

       ob."Object Heading" = holder>>

       current = curMod    >>

}
Report this to a Moderator Report this to a Moderator
 9-Jan-2006 12:56
User is offline View Users Profile Print this message


cliff Bly

Posts: 58
Joined: 11-Apr-2003

I would use the copyobjects dxl found under Tools >> Functions.

1. Create the destination module.
2. Filter the source module for level1 and level 2 headings only.
3. Run the dxl -- selecting the Copy current display set.

-------------------------
Cliff Bly
Report this to a Moderator Report this to a Moderator
 9-Jan-2006 16:21
User is offline View Users Profile Print this message


martin allman

Posts: 74
Joined: 25-Jul-2005

Hi Cliff

The problem is that I have further level of headings level3  and I need to program which parts I want that means I have to devise the dxl myself starting off with this problem

Report this to a Moderator Report this to a Moderator
 9-Jan-2006 17:51
User is offline View Users Profile Print this message


cliff Bly

Posts: 58
Joined: 11-Apr-2003

Answer Answer
Oh -- then the line that has "ob = create(newModule)" will ALWAYS create a level 1 object at the beginning of the module. Hence the wrong order. You will need something like.

-------------------------
Cliff Bly


Edited: 9-Jan-2006 at 17:55 by cliff Bly
Report this to a Moderator Report this to a Moderator
 10-Jan-2006 08:30
User is offline View Users Profile Print this message


martin allman

Posts: 74
Joined: 25-Jul-2005

Thank you Cliff the code snippet was of great help martin
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.