![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
Hi
![]() I'm coding a script that will do the following things:
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.