Page 1 of 1

xtree with compare

Posted: Tue Mar 03, 2009 12:32 pm
by barry.marcus
I've inherited some Vortex code, and I'm trying to decipher it. It contains a call to xtree with a "compare" option (I think). I can't find any documentation on the use of "compare" in xtree. Here is a snippet:

<xtree insert $tech_set compare>
<xtree SET NOADD compare>
<xtree insert $app_set compare>
<$resultSet=$ret>
<count $resultSet>
<$cur=$ret>

Can someone briefly explain to me what the purpose of "compare" is in the above context. Thanks

xtree with compare

Posted: Tue Mar 03, 2009 12:52 pm
by John
In this case "compare" is the name of the tree to use, and would just be used to keep the tree separate from any other uses. With the NOADD the result should be that items that occur just in $tech_set will have a count of 1, and those that occur in both $tech_set and $app_set will have a count of 2.

xtree with compare

Posted: Tue Mar 03, 2009 1:13 pm
by barry.marcus
Silly me! Looking at the documentation again, it makes sense now. I guess I had some sort of tunnel vision and just *assumed* that "compare" was an undocumented option.

Thanks very much for your help John.

Barry