I am having a issue comparing rich text. For example, when I have two objects with identical "Object Text". I save the contents of the "Object Text" into two strings using the function richText(). When Icompare them, the result is the text are not equal. I have printed out the strings and have confirmed that the strings are identical. Thanks for the help! |
Re: Issue Comparing Rich Text Strings
|
Re: Issue Comparing Rich Text Strings
Just a hunch: A common pitfall in DXL is: Object o1, o2 if (o1."Attr" != o2."Attr") print "This will always be true!" if (o1."Attr" "" != o2."Attr" "") print "This will check for inequality of the contents!" The reason is that Object.string returns an attribute reference (Attr__) and that DOORS will compare the two attribute references, not their content, because there is not comparison operator for Attr__ defined.
string richText (Attr__) RTF_string__ richText (Attr__) RTF_buffer__ richText (Attr__)
if (richText o."Attr1" == richText o."Attr2") ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Issue Comparing Rich Text Strings llandale - Wed Feb 08 17:05:41 EST 2012
Mathias is correctly suggesting do this:
|