In VB, "Nothing" is always a shortcut to the default value of a type, whether
the type is a ref type or value type. You just have to use "Is" with ref
types and "=" with value types. This is far more general than the C# "null",
which doesn't apply at all to value types.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
"Göran Andersson" wrote:
> shapper wrote:
> > Hello,
> >
> > I have the following:
> > If MyTag Is Nothing Then
> > ...
> > End If
> >
> > I am getting an error.
> >
> > MyTag is of type HtmlTextWriterTag
> >
> > Private MyTag As HtmlTextWriterTag
> >
> > How can I check if a value was given to MyTag or not?
> >
> > Thanks,
> > Miguel
> >
>
> HtmlTextWriterTag is an enumeration, so the value can never be Nothing.
> A value type always has a value, so you can never check if it has been
> given a value or not.
>
> The default value of a HtmlTextWriterTag variable is
> HtmlTextWriterTag.Unknown. This is the value that the variable will have
> if it has not been assigned any value.
>
> --
> Göran Andersson
> _____
> http://www.guffa.com
>