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: Table or row - what is a header object?
Topic Summary:
Created On: 22-Sep-2006 15:55
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.
 22-Sep-2006 15:55
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

Hi All,

I am working on a code to count the number of rows in each table of a module and discount the (first) row containing the headings. Using the boolean functions table(obj) and row (obj) is not giving me any result. Then I tried to find out the header object for a table in a module containing tables by using the table(obj) function. I am not getting any result again. What is a header object and where does it exist in the module in relation to the table or row? This may not be a smart question but I would like to know where we make use of the above functions.
Thanks in advance

- Krishna
Report this to a Moderator Report this to a Moderator
 25-Sep-2006 08:58
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Tables are built using a hierarchical structure.
The top level object is the Table object.
Below the table object are the row objects.
Each row object has child cell objects.

Table objects are only visible if you hide table cells, then doors displays "Table>>".

To access table objects, you need to use a for object in (all module) loop.
Once you have identified a table object , you can loop thorugh the rows and cells.

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 25-Sep-2006 09:01
User is offline View Users Profile Print this message


Robert Swan

Posts: 86
Joined: 14-Apr-2005

In a previous tread Kim Faint pointed out :- Tables in DOORS are simply an Object hierarchy displayed in the form of a table. The top level Object being the Table Header Object which has a sub-object called a Table Row Object for each row and each of these having a sub-object for each of the table cells. That lead me to this , which should mod to do what you want.:- (probably a mess as shouldn't paste code here // Set all visible Table cells Paragraph Style to Table Text Comments 1) Uses the 'for entire' construct to access all objects, visible or not. 2) Flashy enhancement would be to prompt for true/false/default and set accordingly. */ //--------------declarations---------- Module sm Object so Object ro //row object Object co //cell object string pss //paragraph style string //----------------Main Code Body------------------- so = current Object sm = current Module pss = "Table Text" //future mod = at this point prompt user for required style pss = "" for so in all sm do // use entire for vis and non vis tables { if ((table(so)) && !(isDeleted(so))) { // print "table not deleted" "\n" for ro in table (so) do { //print "\t" "Row Object= " ro."Absolute Number" "\n" for co in ro do { //print "Cell Object= " co."Absolute Number" "\t" //print "\t" co."Object Text" "\n" co."Paragraph Style" =pss }//next cell } //next row } //is undeleted table }
Report this to a Moderator Report this to a Moderator
 25-Sep-2006 16:09
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

Tony, thanks for the clarification. I worked out the attached code to find the number of tables and the rows in each table, discounting the first row, in the module. I did not use the bool firstRow condition. Does it cause any bugs?
From the View menu of the module, I unchecked Table Cells. The object ">> Table" is now the header object. When I run the code  if (table (current Object)) print "YES", the out put is YES. For the same object, when I test the code if (row (current Object)), the output is negative.
How do I test the same code for the header row?
- Krishna
Report this to a Moderator Report this to a Moderator
 25-Sep-2006 16:31
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Sorry Krishna, I didn't explain that very well.

You need to ensure that table cells are visible, not the table header objects.
The loop will catch the table objects even though you can't see them.

Alternatively, you can use the following loop:

fot oTable in entire(module) do...

This form does not respect the display set, so will include tables, rows and cells.
This also includes deleted objects, so you need to ignore these by adding a check such as

if (isDeleted oTable) continue

-------------------------
Tony Goodman
http://www.smartdxl.com
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.