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: Porblem with 'minValue', 'maxValue' properties
Topic Summary:
Created On: 1-Oct-2008 16:34
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.
 1-Oct-2008 16:34
User is offline View Users Profile Print this message


Anurag Chukka

Posts: 13
Joined: 6-Sep-2008

hi,

i am trying to compare two attribute types.(trying to build a isEqualAttributeType function). My function is something as follows:

bool isEqualAttributeType (AttrType at1, AttrType at2)
{
bool bl = true

Skip skp = createString

if (at1.type != at2.type)
{ // different types
bl = false
}
else if (isRanged at1 != isRanged at2)
{ // different ranges
bl = false
}
else if ((isRanged at1 && isRanged at2) &&
((at1.minValue != at2.minValue) ||
(at1.maxValue != at2.maxValue)))
{ // if both are ranges check the limits
bl = false
}elseif(stringOf(at1.type)=="Enumeration")
{//check each value of enumeration}

When i try to use this function , i am getting an error(wrong attribute type 'Integer' for Real
) in the line:

(at1.minValue!=at2.minValue) and (at1.maxValue!=at2.minValue)

Anyone has any idea where it could have gone wrong.
thankyou.
Report this to a Moderator Report this to a Moderator
 1-Oct-2008 19:26
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Can't you just directly compare the two attribute types?

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 1-Oct-2008 19:49
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 58
Joined: 17-Oct-2006

Hi Anurag,

The problem you are having is this: isRanged() doesn't actually tell you if the attribute HAS ranged values...it tells you if the attribute CAN have a range of values.

bool bhasMin = at1.minValue

will return a boolean value telling you if the attribute type HAS a minimum value...if it does, then you can test for the minimum values. Hope this helps.
Report this to a Moderator Report this to a Moderator
 2-Oct-2008 09:58
User is offline View Users Profile Print this message


Anurag Chukka

Posts: 13
Joined: 6-Sep-2008

thanks for your replies.

@douglas: thank you. it helped me.

@david: i want to compare two attribute types in two different modules. so two different attribute types(different basetype, different ranges etc..) may exist with the same attribute type name. That is why i am trying to compare each and every property of the attribute type instead of directly comparing the type name.

I hope i am right.
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.