As the subject said, whats the diff?
I.e;
function some()
if something then
do something
else
return 0 --( or return nil)
end
end
return 0
will be returned as (0) nil wil be returned as ()
Yes, I can see that, but is there any difference in how
Ptokax handle this?
You can return 0, 1, -1, and nil
but I havent get a grip on what the difference is, between it.
I'm wondering this because I want to optimize the script
and thought it would be better to return nil instead of return 0. (Saving memory, that is :D )
QuoteOriginally posted by VidFamne
Yes, I can see that, but is there any difference in how
Ptokax handle this?
You can return 0, 1, -1, and nil
but I havent get a grip on what the difference is, between it.
I'm wondering this because I want to optimize the script
and thought it would be better to return nil instead of return 0. (Saving memory, that is :D )
well return nil is probably better, its what i prefere, u can return anything... not just 0 1 -1, even return "name"
ptokax uses 0 as let, for the rest they are sent to the calling function
edit: nil also i reckon also -1 will all be let numbers, if a functions receives nil, 0 it wont bother returning it will just carry on til it ends... return 1 or other will close the function and return it