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: how do i get the integer value from an enumerated attribute
Topic Summary:
Created On: 24-Aug-2005 18:21
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.
 24-Aug-2005 18:21
User is offline View Users Profile Print this message


Baher Mohamed

Posts: 63
Joined: 21-Jun-2005

I have an enumerated list  High-5, med-high-4, med-3...etc as an attribute.  I want the number value assigned to the choices not the text value....

thanks...

i can do something similar to this by creating an int variable and set it equal to 5,4,3..etc depending on the text returned...

if (text == "blah")
    new_variable=5

Report this to a Moderator Report this to a Moderator
 26-Aug-2005 11:40
User is offline View Users Profile Print this message


Graham Stradling

Posts: 67
Joined: 19-Sep-2002

All you need to do is to cast the enumeration into an integer variable.

For example, I want to find the priority number from your list, for the current object I would use:-

Object o = current
int myInt = o."Priority"
print myInt""


myInt will be set to the value specified by the enumerant, so if my object has a priotity of high, myInt would be set to 5

-------------------------
Graham Stradling,

Alcatel-Lucent.
Report this to a Moderator Report this to a Moderator
 26-Aug-2005 13:58
User is offline View Users Profile Print this message


Baher Mohamed

Posts: 63
Joined: 21-Jun-2005

Thanks! Much appreciated.
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.