I wrote:
MfgRecipeTypeKey = If(placeholderMRTK Is Nothing, 0, placeholderMRTK)
and all this is fine, but when placeholderMRTK is really nothing, it fails without throwing an exception, just leaving the sub (MyBase.Load for the dialog form) and continuing to work with the application. When I rewrite it as:
If placeholderMRTK Is Nothing Then MfgRecipeTypeKey = 0 Else MfgRecipeTypeKey = placeholderMRTK End If
It works great. I thought these two are logical equivalents.
So:
1) What is the actual difference between the two that I don't know about?
2) Why can the first fail? I wonder if this is some kind of creepy type conversion problem, but are both placeholderMRTK and MfgRecipeTypeKey declared as Byte? (with zero byte).
3) Why execution just drops out of sub without representing me with an exception. When this line is highlighted in Visual Studio (if it matters for Pro 2013), and f11 for the next line, it just jumps and fires the datagrid rendering event, and then presents my dialog, but without any important data assignments occurring under hood, And given that he is doing this (is this new behavior in 2013?), How should I debug?
Thank you for your time and attention!
source share