Difference of returnS?

Lord Ganja

New member
Messages
161
Points
0
Age
34
Location
Ganja World
What are the differences of return, return 1, return 0, return true, return false, and any other return?

 
Last edited by a moderator:
It depends on return type of function, and what does function do...

 
@@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.

 
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

 
Thank you for you answers
default_smile.png


 
Back
Top