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: Reading all specific object's attribute to an array
Topic Summary:
Created On: 12-Mar-2003 04:59
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.
 12-Mar-2003 04:59
User is offline View Users Profile Print this message


Pete Kowalski

Posts: 301
Joined: 7-Feb-2003

Hi

I'm coding a script that will do the following things:

    Open a specific module
    Read and store a specific attribute of every object in an array
    Detect and display any duplicate attribute entry

So far I have tried unsuccessfully to code reading the specfic attribute "Legacy No." of every object in an array. "Legacy No." can just hold one value. My logic seems to be correct but what could I be doing wrong? Any help will be apprecitated.

Here is the code ...

filtering off;
Module m = current Module;
Object o;
Array RawLeagacyNoArray = create[];


for o in m do
{
AttrDef Legacy No.;
put (RawLegacyNoArray Legacy No.);
}



Thanks.

-------------------------
pete.kowalski(at)motorola.com
Report this to a Moderator Report this to a Moderator
 12-Mar-2003 14:11
User is offline View Users Profile Print this message


Michael Sutherland

Posts: 248
Joined: 13-Sep-2002

Pete,

The DXL Array (note the capital 'A') is a "dynamically sized two-dimensional array", so to put something in it, you need to specify four parameters:

put(Array a, type data, int x, int y)

The data can be of any type. The integers x and y are the coordinates (location) of the data.

Getting the data back requires three parameters:

type get(Array a, int x, int y). The integers x and y are the coordinates (location) of the data.

If you are doing a lot of data storage/manipulation with DXL, take a look at Skip lists. They are specifically designed to detect the insertion of duplicate data.

-------------------------
Michael Sutherland
michael@galactic-solutions.com
http://galactic-solutions.com
Report this to a Moderator Report this to a Moderator
 13-Mar-2003 19:49
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Sutherland's idea of Skip Lists is a good one. In this case, I think the "Key" is the attribute value, and "Data" is the "object" reference.

Forget about "AttrDef", as that is used in conjunction with the Definition of the attribute, not each object's values.

See the attached code snipette, that may help get you started.

- 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.