Re: Use of the CALL keyword
I have not known Call to have a determental effect.
It is included with the language more for backward compatibility than practical use however.
Re: Use of the CALL keyword
Please check Call statement thread. ;)
Re: Use of the CALL keyword
The difference is purely syntactic.
In VB6 calling a procedure without trapping its return value means you do not use the parentheses around the argument list.
VB Code:
MySub arg1, arg2
' vs.
ret = MyFunc(arg1, arg2)
Call allows you to call a Sub, or call a function without trapping its return value, and use the argument parentheses as well.
Make of it what you wish, I think it's fairly pointless.
BTW in VB.NET both types of procedure call can be effected using the argument parentheses now, so in VB.NET the Call keyword truely is obsolete.
Re: Use of the CALL keyword
Quote:
Originally Posted by penagate
BTW in VB.NET both types of procedure call can be effected using the argument parentheses now, so in VB.NET the Call keyword truely is obsolete.
As it probably should have been in VB6. :thumb:
Re: Use of the CALL keyword
I'e noticed this in the past, and never really knew the difference between
as opposed to
I think some people like to use it as it "stands out" a bit more that the code is calling another routine.
Re: Use of the CALL keyword
What about if you want to call a process without passing it any arguments, would it be better to use Something() than to use Call Something?
Re: Use of the CALL keyword
Quote:
Originally Posted by shirazamod
What about if you want to call a process without passing it any arguments, would it be better to use Something() than to use Call Something?
It doesn't matter. Both of these will execute whatever code is in the Something Sub
VB Code:
Private Sub Command1_Click()
Something
End Sub
Private Sub Command1_Click()
Call Something
End Sub
Re: Use of the CALL keyword
Apart from the fact that you can't actually do Something(), only Something, like I said there's no difference.
In VB.NET, and other languages, it would be Something(), yes.