Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

class containing an object instance

Hai All,

I don't know why when I try to debug and print a value of the object instance of the class, it gives an hex number, instead of Integer value. Let me show you my code to better understand the problem I am facing. I have a serializable class

<Serializable()> _
   Public Class conventionPayment
        'Other fields
     Private regisYear As Integer
        Public Sub New()

        End Sub
        ' Do shallow cloning
        Function ShallowClone() As conventionPayment
            Return CType(Me.MemberwiseClone(), conventionPayment)
        End Function

         Function DeepClone() As conventionPayment
            Dim m As New MemoryStream
            Dim b As New BinaryFormatter
            b.Serialize(m, Me)
            m.Position = 0
            Return b.Deserialize(m)
        End Function

       Public Property regYear() As Integer
                Return regisYear
            End Get
            Set(ByVal Value As Integer)
                regisYear = Value
            End Set
        End Property
'other properties
End class
And... I have another class that contains an object of the above class

 Public Class cancellationClass
      'other field here

        Private cancelledConvReg As New PaymentUtils.conventionPayment

        Public Property cancelledConventionReg() As PaymentUtils.conventionPayment
                Return cancelledConvReg
            End Get
            Set(ByVal Value As PaymentUtils.conventionPayment)
                'cancelledConvReg = Value.DeepClone                  
                cancelledConvReg.transID = Value.transID           'Line#K
            End Set
        End Property
     'other properties
End class

Actual object assignment:

Dim cancelledObj As PaymentUtils.cancellationClass
 cancelledObj = New PaymentUtils.cancellationClass
 cancelledObj.cancelledConventionReg = objConv   'this objCon is an object of conventionPayment.  
                   ' I don't see any problem with this object  and this objCon is assigned with correct values.

When I try to DEBUG at line#k (see above), Value.regYear displays '&H7D4' which is hex number equivalent of 2004.

Why is that? regYear is integer and I want to assign integer (in decimal system) value to it . Am I missing something?.....

1 Solution
karthikeyanTPAuthor Commented:
I figured it and solved myself. Accidently, QuickWatch Value is set to Hexadecimal value. I turned it off now. Ovvv....:)

I am going to close this question.
Question answered by asker or dialog valuable.
Closed, 50 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now