@pjt33 said:
@arbitrary said:You're not a .Net developer I take it. The result of assigning Nothing (equivalent to null in the C family of languages) to an Integer (primitve type like int) is that the value will end up as 0.
I am a .Net developer, but I didn't know that. I suspect it's limited to VB.Net. C# would just give a compile-time error.
Nothing is both the Null and the default() of VB.Net.
When used on an object it's Null.
When used on a non-object (primitive, structure) it's default(T)
Ofcourse, default(Int32) is just plain 0, so it's like saying: if (bar == 0) { bar = 0; }