Q's of: static, variable, and return functions
#2

return has different meanings in different functions but the basic use looks like this:

pawn Код:
Function()
{
    return 5;
}

if(Function() == 5)
{
    // true
}
else
{
    // false
}
It returns a value to the place it was called. In that example Function() returns 5.

Variable can be dynamic or static. Difference is that dynamic variable gets deleted when it's not used anymore (out of scope), but static variable is always there (like global variables).

It's all explained in wiki:

return: https://sampwiki.blast.hk/wiki/Control_Structures#return
static/non-static: https://sampwiki.blast.hk/wiki/Scripting_Basics#Scope
Reply


Messages In This Thread
Q's of: static, variable, and return functions - by ||123|| - 22.07.2011, 10:25
Re: Q's of: static, variable, and return functions - by MadeMan - 22.07.2011, 10:45
Re: Q's of: static, variable, and return functions - by ||123|| - 22.07.2011, 11:35
Re: Q's of: static, variable, and return functions - by Double-O-Seven - 22.07.2011, 11:42
Re: Q's of: static, variable, and return functions - by Grim_ - 22.07.2011, 11:46
Re: Q's of: static, variable, and return functions - by MadeMan - 22.07.2011, 11:53
Re: Q's of: static, variable, and return functions - by ||123|| - 22.07.2011, 12:01
Re: Q's of: static, variable, and return functions - by Roko_foko - 22.07.2011, 12:16

Forum Jump:


Users browsing this thread: 3 Guest(s)