Return Statements
#3

Quote:
Originally Posted by M4z
View Post
I'm a beginner at Pawn, I don't understand what the return statements are used for. Can anyone explain them to me alongside with some examples of there use.
Basically, I don't understand the purpose of them and I have no idea when I would use return 1; or return 0; If anyone could clear this up for me, it would be very much appreciated!
The return statement ends a function and sets the result of the function. It
need not appear at the very end of the function; early exits are permitted.

A function can only have a single return value —that is, a return statement in a function
may only contain one expression.

If a function has one output value, you typically use a return statement; if a function has
more output values, you use reference arguments.

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf
Reply


Messages In This Thread
Return Statements - by M4z - 21.08.2011, 17:28
Re: Return Statements - by Cameltoe - 21.08.2011, 17:32
Re: Return Statements - by mprofitt - 21.08.2011, 17:37

Forum Jump:


Users browsing this thread: 2 Guest(s)