Jump to content
  • 0
Lord Ganja

Difference of returnS?

Question

What are the differences of return, return 1, return 0, return true, return false, and any other return?

Edited by Lord Ganja

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

 

It depends on return type of function, and what does function do...

Ohh. Okay. So if it's like ' -1 = yes, 0= no, 1 = maybe '

return 0 will be no and return -1 will be yes?

 

Depend on what you want the script/function to return. 

It's depend on what you want it to be, what these value will be represent.

It's all define by yourself.

 

Or course, these "1/0" , "true/false" are some standard that you could follow.

Useful to indicate the outcome of function is "success/fail" ...

 

https://answers.yahoo.com/question/index?qid=20121125180438AAk9sSo

Share this post


Link to post
Share on other sites
  • 0

It depends on return type of function, and what does function do...

Ohh. Okay. So if it's like ' -1 = yes, 0= no, 1 = maybe '

return 0 will be no and return -1 will be yes?

Share this post


Link to post
Share on other sites
  • 0

@@Lord Ganja

 

Usually return 0 and return false, mean the same.

The same is true for return 1 and return true.

 

Every other return value is usually either data or some kind of success/error code.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.