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: Retrieving objects by object number
Topic Summary:
Created On: 23-Jan-2009 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.
 23-Jan-2009 15:55
User is offline View Users Profile Print this message


Agustine da Silva

Posts: 6
Joined: 26-Sep-2008

Hi,

I'm trying to retrieve various object from a module by Object Number. I know we can retrieve objects either by Absolute Number ( gotoObject (int absno, Module m) ), or by position in a displayed module (first (object O), last (Object o) etc.).

However I would like to get the first and last object in a module, regardless of what is displayed in the current view.

The only way I know how is to use the: for o in entire (module) do {...} loop. This is rather inefficient, especially if I wanted to retrieve the very last object in a large module.

Is there another, more direct way?

Thanks.


Agustine
Report this to a Moderator Report this to a Moderator
 23-Jan-2009 20:10
User is offline View Users Profile Print this message


Uma Unnikrishnan

Posts: 14
Joined: 8-Jul-2008

Hi Agustine,

You can use Object o = first m or o = last m where m is the module. However this works on whatever is displayed in the current view..you might have to turn off filtering/sorting to get the actual first and last objects.

Rgds,
Uma
Report this to a Moderator Report this to a Moderator
 23-Jan-2009 20:27
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Most of those goto object commands 'respect' the current display set, so you cannot gotoObject that isn't displayed. That makes the lot of them practically worthless.

Using Object Number has a rather odd limitiation: non-displayed deleted objects often share the exact same Object Number as a sibling object. If you create three objects under section 1, their AbsNo(Numbers) are: 2(1.1), 3(1.2), 4(1.3). If you delete object 3 and don't show deletions, what you see is 2(1.1), 4(1.2). What's the number of object 3? Well, its also 1.1. And if you then show deleted objects, then the original association of Numbers to AbsNos applies, changing the Number of 3 and 4. Yuuuck.

I'm guessing that the last(obj) command likewise 'respects' the display set, making navigating around non-determinant.

Not sure what to tell you, but perhaps put all the Objects in a Skip List, using [for obj in entire mod do] loop, and then go from there.

- Louie
Report this to a Moderator Report this to a Moderator
 26-Jan-2009 14:30
User is offline View Users Profile Print this message


Agustine da Silva

Posts: 6
Joined: 26-Sep-2008

Wow, I forgot about deleted objects...that could be a problem then. I was hoping to avoid getting and parsing through all the objects, but it seems like there's no other alternative.

Thanks for the tips though.


Agustine
Report this to a Moderator Report this to a Moderator
 28-Jan-2009 11:03
User is offline View Users Profile Print this message


Eric Piallat

Posts: 33
Joined: 26-Jan-2004

There is an alternative!

Looping through object's descendant ignores current filter and sort, but not the "display deleted objects" parameters.

So you have to recursively loop through "top current Module", then on each descendant.

test this on a sorted module:
Object o
for o in top current Module do print (identifier o) "\n"

-------------------------
E. Piallat
CeBeNetwork
Report this to a Moderator Report this to a Moderator
 29-Jan-2009 15:04
User is offline View Users Profile Print this message


Agustine da Silva

Posts: 6
Joined: 26-Sep-2008

Thanks Eric!

That's definitely an alternative to retrieving every single object.
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.