If a = 4 and B < 8 I want to do some stuff!
Should it be written:
Code: Select all
method 1.
If a = 4 And B < 8 Then
'some stuff here
End If
or
method 2.
If (a = 4) And (b < 8) Then
'some stuff here
End If
"Note that the conditional expression is not required to be enclosed in parentheses. Many programmers are accustomed to other languages where they are required and therefore do so out of habit. Others believe that the parentheses improve the readability and use them for that reason. You’re free to adopt whichever practice suits you."
What happens if you write:
Code: Select all
method 3.
If (a = 4) And b < 8 Then
'some stuff here
End If
Any enlightenment will be appreciated.
Vic