J
Jim Owen
I'm a C# guy, recently having to work in VB.Net. I am trying to pass a null
value into an integer property. My code looks like this:
If MyIntVar = 0 Then
MyObject.MyIntProp = Nothing
Else
MyObject.MyIntProp = MyIntVar
End If
When I step through it, the line assigning the property to Nothing is
getting run, but afterward the property is still showing that it is = 0.
Subsequent code fails because this property cannot be 0. How am I supposed
to do this?
value into an integer property. My code looks like this:
If MyIntVar = 0 Then
MyObject.MyIntProp = Nothing
Else
MyObject.MyIntProp = MyIntVar
End If
When I step through it, the line assigning the property to Nothing is
getting run, but afterward the property is still showing that it is = 0.
Subsequent code fails because this property cannot be 0. How am I supposed
to do this?