![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Porblem with 'minValue', 'maxValue' properties Topic Summary: Created On: 1-Oct-2008 16:34 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
Can't you just directly compare the two attribute types?
------------------------- David Pechacek AAI Services Textron dpechacek@sc-aaicorp.com David.Pechacek@gmail.com |
|
![]() |
|
![]() |
|
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. |
|
![]() |
|
![]() |
|
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. |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.