First of all, answer is 'YES'.
Well, basically structure type cannot be used by reference type.
Which means, structure type cannot be Nothing(null).
(ref
Reference Type: Classes, Interfaces, ...
Value Type(Non reference type): Enum, Structure, ...
I don't know completely list of reference type and value type.
BTW, implementation is this:
[Public | Dim | Private] NameOfVariable As [NonReferencedType]?
for example:
Dim intNullable As Int32?
-> Internally data type of this code will change like this:
-> Dim intNullable As System.Nullable(Of Int32)
And using '?' to suffix, you can also use 'Is Nothing' or 'IsNot Nothing' statement.
This is very useful when you calling API.
complete example:
This code's result will false. Cause 'Int32' is structure type and not referenced.Code:Function GetNullableStructure() As Int32 Return Nothing End Function Debug.Print(IsNothing(GetNullableStructure))
This code's result will true. Cause 'Int32' is structure type but 'System.Nullable(Of T)' makes structure type as reference type.Code:Function GetNullableStructure() As Int32? Return Nothing End Function Debug.Print(IsNothing(GetNullableStructure))
sorry for my bad english and expression
I hope this post will helpful to you guys![]()