For what it's worth i agree with killer42, I prefer to read and write code without writing "call".
I believe it's a preference that will differ between programmers.
My point is that with an extensible language such as this, once you create a Sub or Function it effectively becomes part of the language. It's a "black box", presumed to have been tested and working. There should be no need to differentiate by using a special type of call. The name of the routine should be enough to tell you what it does. If there's any question about where the routine comes from, a simple keypress will tell you.
Is it right if you use call to call a function the return value is ignored? I was unaware of this.
Does this not remove the whole point of calling a function?
Well, yes and no. If you need the return value, then sure, it defeats the purpose. But keep in mind that since the function can contain any code you like, it may actually
do something. You may want to treat it like a Sub in certain circumstances and not bother with a returned value.
The MsgBox function is a prime example. You can use it to prompt the user and determine what button they clicked. Or you can just show a message and wait for the user to click OK. Do you need to
know that they clicked OK?
Examples...
-
Dim UserResponse As Long
-
-
' Before performing some action...
-
UserResponse = MsgBox("Are you sure?", vbYesNoCancel, "Confirm Action")
-
-
' After performing some action...
-
MsgBox "Finished!"
-