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: Unable to extract ALL Attributes names from Module
Topic Summary: Some attributes do not show up via the for AttrDef in loop.
Created On: 26-Jun-2007 22:03
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 Norberto Silva, on Wednesday, June 27, 2007 4:15 PM

Answer:
EXCELLENT!!!.

I had some legacy code in which STRING was used instead of ATTRDEF. Need to brush up on the latest docs.

THANKS.
 26-Jun-2007 22:03
User is offline View Users Profile Print this message


Norberto Silva

Posts: 8
Joined: 25-Nov-2002

The only way I know how to display all the attributes in a module is:

string aAttrName
Module mm = current
for aAttrName in mm do {
print "attribute name =" aAttrName "\n"
}

However, I have a module where I can not extract all the attributes I can see via "Edit->Attributes".
The only things in common with the "stubborn" attributes are:

1. They are all Module-level Attributes. (none are Object Level attributes)
2. They are all User-Generated. (not built-in system attributes)
3. They can be modified but the code above refuses to list them.

The really crazy thing is that I can do...

AttrDef ad = find(current Module, "NameOfStubbornAttribute")

AND IT RETURN THE RIGHT ATTRIBUTE OBJECT!!!!!!!

I am totally clueless on this one.
Report this to a Moderator Report this to a Moderator
 27-Jun-2007 14:25
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

You are correct. Module level attributes won't show in that loop since its a loop for object level attributes. You can use

AttrDef ad

for ad in current Module do {
print ad.name "\n"
}

for a more complete listing. However, things like Object Identifier, Object Level, and Object Number still won't show.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 27-Jun-2007 15:34
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Alternative, if you don't what to use AttrDefs.
The word attributes forces the loop to return module attributes rather than object attributes.

Module m = current
string attr = ""

for attr in attributes m do
{
print(attr " = " m.attr "\n")
}

-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 27-Jun-2007 16:15
User is offline View Users Profile Print this message


Norberto Silva

Posts: 8
Joined: 25-Nov-2002

Answer Answer
EXCELLENT!!!.

I had some legacy code in which STRING was used instead of ATTRDEF. Need to brush up on the latest docs.

THANKS.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.