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
And when I click on go to definition on SetVars, I am taken to the following definition-
Private Sub SetVars(i As Integer)
I am new to VB. Is this something that is common in VB, to allow function calls without the paranthesis?
As Ryan has pointed out, parentheses should only be used when calling a function that will return a value.
One pitfall I would like to add is that if you actually DO use parenteses unintentionally when calling a Sub, VB6 will pass the parameter by value instead of by reference.
When the Sub takes more than one parameter, this is not a risk, since this is an illegal syntax in VB6:
But consider this example:
So be aware of how you use the parentheses, a small change may have unexpected effect.