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: DXL access to enumerated attribut type
Topic Summary:
Created On: 6-Sep-2004 09:14
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 Tony Goodman, on Monday, September 6, 2004 9:45 AM

Answer:
Frank,

You need to use the attribute type size property in your loop as follows:

for (i = 0; i < at.size; i++)
{
strVal = at.strings

// at.values
// at.colours etc ...

}

 6-Sep-2004 09:14
User is offline View Users Profile Print this message


Frank Held

Posts: 14
Joined: 16-Jul-2004

Hi

How can i receive the Elements of an enumerated Attribute. Neither i know know how many alternatives are declared nor their related numbers.
I tried the following, but when i is at the end of the enumeration I get an error instead of val==null

Module m = current Module
string attrib = "status"
AttrDef ad = find(m, attrib)
AttrType at = ad.type
int i
string val = ""
for (i=0; val!=null; i++) {
val=at.strings
print val
}




-------------------------
Frank
Report this to a Moderator Report this to a Moderator
 6-Sep-2004 09:25
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Answer Answer
Frank,

You need to use the attribute type size property in your loop as follows:

for (i = 0; i < at.size; i++)
{
strVal = at.strings

// at.values
// at.colours etc ...

}



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


Frank Held

Posts: 14
Joined: 16-Jul-2004

Thanks Tony for Your fast response

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