I am looking at VB6 code and I see a statement as follows -
Public Sub CheckXYZ(abc As Integer)
If abc <> pqr Then SetVars abc
<
This is a feature of VB6 (one which gladly was taken away in VB.NET) and is legal syntax.
However I would not recommend using it because it can make the code more difficult to read and as @GTG pointed out can force ByVal when the method declaration is ByRef if you are not careful.
(See the MS Documentation about this here)
As such my advice is to always use the parentheses. If you see a space between the method name and the first bracket like this:
SomeSubName (abc)
This alerts you to the fact that something is wrong (i.e. abc if being forced to be passed ByVal
) so you need to use Call
and the space will be removed:
Call SomeSubName(abc)
This makes all your method calls consistent within your code.
In the rare circumstances where you want to force abc
to be passed ByVal
you can do this which makes it much more obvious:
Call SomeSubName((abc))