* "Ricky W. Hunt" <rh*****@hotmail.com> scripsit:
How does VB.NET determine comparing vs. assigning?
For instance, if "checkbox1.checked = True" it only checks the value but
leaves it as it whereas if you have "checkbox1.checked = True" by itself it
changes the value. Is that correct? I believe in C you have a "=" and a "=
=",
one for assigning and one for comparing. Am I understanding VB.NET
correctly?
In VB.NET, the '=' operator is /overloaded/ for assinging and comparing,
depending on the situation. Notice that 'a = b = 1' will result in
differewnt results in VB.NET and C#. In VB.NET, the 2nd '=' compares
'b' with 1 and assigns the result ('True'/'False') to 'a'. In other
programming languages, 'b' is assigned 1, and 'a' get's 'b''s value, 1.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>