![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Testing Attribute Equality Topic Summary: Created On: 7-Dec-2006 21:25 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I am attempting to fix a script (comparison of a baseline to the live module) that someone wrote long ago. It is not behaving and from what I hear it has never truly returned a completely correct answer. In the code they are doing something like the following
if( oldObject.attrList[x] "" != newObject.attrList[x]"") { // do some stuff } where attrList is an array populated with attribute names, thus a comparison of 2 attributes. Is this valid? It sure doesn't seem to be correct. Unfortunately debugging this thing is a monster as the script has been running for an hour now to get to a point where I can see the output. Pure nastiness!! Edited: 8-Dec-2006 at 14:42 by Marlin Wegner |
|
![]() |
|
![]() |
|
Appears you made a typo in oldObject.attrList "" since it doesn't have an array index.
|
|
![]() |
|
![]() |
|
I suspect the index is [ i ], which is interpreted as the 'italic' command by this message board.
Best bet is to type code in the 'attach code' window - it doesn't suffer from such interpretation problems, and it preserves indenting. And to move towards answering the question, I have a tendency to stick to the 'one step at a time' approach, so I'd get the names of the attributes from the array first, then get the attributes from the object, then compare them, rather than trying to be smart (and screwing it all up...) Paul. ------------------------- Paul dot Tiplady at TRW dot com TRW Automotive Edited: 8-Dec-2006 at 07:56 by Paul Tiplady |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Testing Attribute Equality
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.