Viewed 79k times. Personally, I prefer the return. My question is, what is the internal difference, if any, between the two? Improve this question. Add a comment. Active Oldest Votes. It immediately exits the function No further code in the function executes! It sets the function return value at that point Other code in the function continues to execute This enables additional logic to refine or override the function return value Huge difference folks.
Remember it's not all about state, it's also about flow. Improve this answer. He didnt ask about that. He asked about using a return value not statement or assigning the value to the function name. He actually asked at "My question is, what is the internal difference, if any, between the two? StingyJack - You interpret the question to be about "using a return value not statement ". I'm not sure what that means, but I do suspect that the consensus here is that "return" in the phrase "return value" from the question does indeed refer to the return statement and "value" refers to it's argument.
In your other comment to me, you referred me to stackoverflow. As said above, the IL will be different using any non-trivial example. Let's take a look TGnat TGnat 3, 8 8 gold badges 33 33 silver badges 45 45 bronze badges.
Interesting: the implicit return saved one instruction. Nice post. Perhaps it is there simply because the return is not optimized away? Return is compatible with C is more readable for more programmers and it sounds better — Rulas.
Rulas, your comment is irrelevant and unjustified, please read all responses and comments before commenting. It should be noted that this is only in debug mode thus, irrelevant! Join Us Close. Join Tek-Tips Forums! Join Us! By joining you are opting in to receive e-mail. Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Students Click Here. That latter has to return a value to the calling "Manager" say, numeric success code, or just Boolean one. Return lnSuccess End End Sub. ExitCode I believe. Did you mean Environment. Exit int32 exitCode? Regards, Ilya. That'll show me to always pay attention. No, I didn't mean Environment. Exit int32 exitCode I meant exactly what I said: Environment.
Quit nRet Sample runs: cscript Quit is the way to return an exit code from your script You start another process by using. Run or. Run returns the exit code of the called process. Exec sets. ExitCode after termination! Horner Ekkehard. Horner Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. United States English. Ask a question. Quick access.
Search related threads. Remove From My Forums. Answered by:. Archived Forums. Do not post in this forum Sign in to vote. Hi, Iam trying to call a vb.
Any help would be much appreciated. Thanks, Krishna. Krishna Prakash. Monday, March 26, AM. Marked as answer by Krishna. Tuesday, March 27, PM. Try this link for your question.
0コメント