In the C programming language, “DO TASK” always runs because a is assigned the value 1, rather than compared to the value 1:
int a;
a=0;
if (a=1)
{
//DO TASK
}
I am trying to figure out how this works in VB6 and .NET. The following article suggests that the equality operator in .NET is ‘=’ and not ‘==’: http://msdn.microsoft.com/en-us/library/215yacb6.aspx.
What is the equality operator in VB6 and VB.NET?
Yes
=is the equality operator in VB6 and VB.Net.Can I respectfully suggest that you read the documentation? Trial and error is a very slow way to learn a language. Here’s the VB6 documentation
=operator