Pages

Monday, June 25, 2012

Check if two layer nodes are in fact equal

Here's an example on how to check if two layers of a treenode match with no differences:

static void CompareTwoHighestLayers(Args _args)
{
    TreeNode    treeNode = TreeNode::findNode(@'\Data Dictionary\Tables\CustTable');
    SysTreeNode node1;
    SysTreeNode node2;

    node1 = SysTreeNode::newTreeNode(SysTreeNode::getLayeredNode(treeNode, 0)); // 0 = Highest layer of the treenode
    node2 = SysTreeNode::newTreeNode(SysTreeNode::getLayeredNode(treeNode, 1)); // 1 = Next highest layer of the node
    
    info (strFmt("Equal (%1 <--> %2): %3", SysTreeNode::getLayer(node1.parmTreeNode()), SysTreeNode::getLayer(node2.parmTreeNode()), SysCompare::silentCompare(node1, node2)));    
}

No comments: