What would happen if...
#1

...I don't allow a function to return a value?
Example:

pawn Код:
forward Loop();
public Loop()
{
    foreach(Player,i)
    {
        printf("There are %d players connected.",i);
    }
    //if I don't return a value here, what would happen?
}
Same thing for stock and normal functions.
Reply
#2

Nothing would happen, I guess
Reply
#3

I think you'll have a warning.

EDIT: Why don't you compile and look what it gives you?
Reply
#4

I think I read somewhere functions should always return a value. And no, I won't receive warnings, I just want to be on the safe side.
Reply
#5

Functions only need to return a value if that value is assigned or checked somewhere.
Reply
#6

Okay, thanks much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)