G
Guest
What is the use of (return ) statment in functions?
in fact i have got mess with function can't catch it feel lost?
in fact i have got mess with function can't catch it feel lost?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
BradC said:The main difference is that in the first example, the return acts as an EXIT
FUNCTION, and NO code after it will be executed. In the second example, any
additional code after the "FunctionName =" statement WILL be executed.
* "Jeremy Cowles said:Using the "Return" statement allows you to change the name of your function
without any modification to it's body. And is the preferred method of
returning data.
Herfried K. Wagner said:Why? Assigning something to the name of the function and /then/ calling
'Return' followed by the name of the function will work too.

* "Jeremy Cowles said:And then if you change the name of the function, your code is broken, unless
you turn Option Explicit Off, and in that case, your probably not worried
about the quality of your code anyway. You say tomatoe, I say tamatoe...
* "Cor said:Herfried says probably tomate
Herfried K. Wagner said:Then all the code calling the function will be broken too. Interfaces
(and methods are part of them) should be "stable", names of methods
should not be changed.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.