Converts an integer to a numeric node identifier for comparissons.
This produces the following output (taken from C# example):
Comparing NodeId to uint
Comparing 100 to 100 = [equals] True
Comparing 100 to 100 = [ == ] True
Comparing 100 to 101 = [equals] False
Comparing 100 to 101 = [ == ] False
C# | ![]() |
---|---|
//create some variables uint id1 = 100, id2=101; NodeId node1; //create our node node1 = new NodeId(id1); //now to compare the node to the ids using a simple comparisson and Equals: Utils.Trace("Comparing NodeId to uint"); Utils.Trace("\tComparing 100 to 100 = [equals] {0}", node1.Equals(id1)); Utils.Trace("\tComparing 100 to 100 = [ == ] {0}", node1 == id1); Utils.Trace("\tComparing 100 to 101 = [equals] {0}", node1.Equals(id2)); Utils.Trace("\tComparing 100 to 101 = [ == ] {0}", node1 == id2); |
Visual Basic | ![]() |
---|---|
'create some variables Dim id1 As UInt = 100 Dim id2 As UInt = 102 Dim node1 As NodeId 'create our node node1 = new NodeId(id1) 'now to compare the node to the ids using a simple comparisson and Equals: Utils.Trace("Comparing NodeId to uint") Utils.Trace( String.Format(" Comparing 100 to 100 = [equals] {0}", node1.Equals(id1)) ) Utils.Trace( String.Format(" Comparing 100 to 100 = [ = ] {0}", node1 = id1) ) Utils.Trace( String.Format(" Comparing 100 to 101 = [equals] {0}", node1.Equals(id2)) ) Utils.Trace( String.Format(" Comparing 100 to 101 = [ = ] {0}", node1 = id2) ) |
Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2015, .NET4.x