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: Navigating a table in DXL
Topic Summary:
Created On: 20-Oct-2008 15:26
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 Peter Albert, on Tuesday, October 21, 2008 9:29 AM

Answer:
I guess you are searching for these two routines:

Object getTable(Object tableCell): Returns the header object of the table containing tableCell.
Object getRow(Object tableCell): Returns the header object of the row containing tableCell.

Regards,

Peter
 20-Oct-2008 15:26
User is offline View Users Profile Print this message


Alan Gooch

Posts: 107
Joined: 30-Aug-2005

Using DOORS v71173

I have been tasked with proving a script which traverses links between modules to pick out some information.
The structure is quite straightforward:-

Mod1 <-- Mod2 <-- Mod3 --> Mod4

(so Mod2 is the source end of a link between an object in Mod2 and an object in Mod1, and Mod3 is the source end of links to both Mod2 and Mod4)

This in itself doesn't pose any problems ... except that the links in Mod3 are in a table.

In Mod3 a table cell linked to an object in Mod2 is on the same row as the object linked to Mod4, so I have something like:-

Table Header Object
cell-1 cell-2 cell-3 cell-4
cell-5 cell-6 cell-7 cell-8
cell-9 cell-10 cell-11 cell-12

The link to Mod2 comes from cell-6, and the forward link to Mod4 comes from cell-8.

I can use cell(oOrigObj) to determine that the object is part of a table, but can I navigate around the table to determine that cell-8 is on the same row and use the link it provides me with to get to Mod4?

I expected something like:-
oHdrObj=tableheader(oOrigObj)

to get me to the table header object, so I could loop with:-
for oRow in table(oHdrObj) do
for oCell in row(oRow) do

to find the cell(s) in the same row as the original object (oOrigObj) I started with. But I can't find any mention of being able to map back to the table header from the cell object.

Suggestions on a postcard.

TIA.
Report this to a Moderator Report this to a Moderator
 20-Oct-2008 15:39
User is offline View Users Profile Print this message


Peter Albert

Posts: 232
Joined: 30-Dec-2005

Answer Answer
I guess you are searching for these two routines:

Object getTable(Object tableCell): Returns the header object of the table containing tableCell.
Object getRow(Object tableCell): Returns the header object of the row containing tableCell.

Regards,

Peter
Report this to a Moderator Report this to a Moderator
 20-Oct-2008 22:01
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

If your oMod3 is a cell(), then you can find all objects in that object's row by first using the 'first(sibling(oMod3))' and then in a loop getting the 'next(sibling(oMod3))' untill you get a null object returned. See attached.

- Louie
Report this to a Moderator Report this to a Moderator
 21-Oct-2008 08:39
User is offline View Users Profile Print this message


Eric Piallat

Posts: 33
Joined: 26-Jan-2004

--- sorry for double-post

-------------------------
E. Piallat
CeBeNetwork

Edited: 21-Oct-2008 at 08:40 by Eric Piallat
Report this to a Moderator Report this to a Moderator
 21-Oct-2008 08:39
User is offline View Users Profile Print this message


Eric Piallat

Posts: 33
Joined: 26-Jan-2004

When handling tables, I rather use the bracket-notation:

With oTable = getTable obj,

You may then use oTable[2][3] as the third cell of the second row.

Please note there is no "zeroth" column nor row.

In your particular case, checking your cell is from the second column of the table, then finding links from the fourth column of current row will be written:

-------------------------
E. Piallat
CeBeNetwork
Report this to a Moderator Report this to a Moderator
 21-Oct-2008 09:29
User is offline View Users Profile Print this message


Alan Gooch

Posts: 107
Joined: 30-Aug-2005

Thanks all.
Using getTable works fine.
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.