There is a difference in operators when a C# developer has to do VB.NET
For example: && vs And.
THEY ARE NOT THE SAME. The && equivalent in VB.NET is AndAlso
If you do this:
Sub Main() Dim result = Part1() And Part2() Console.ReadLine() End Sub Function Part1() As Boolean Console.WriteLine("Part 1") Return False End Function Function Part2() As Boolean Console.WriteLine("Part 2") Return True End Function
What do you think it prints?
If And would behave like && in C# it would print
Part 1
But unfortunately BASIC is different (sigh), it prints
Part 1
Part 2
This can be solved by using AndAlso, which is the short circuited version of And.