Question about Scope
#2

thats what pawn language guide is for

• Static local declarations
A local variable is destroyed when the execution leaves the compound block
in which the variable was created. Local variables in a function only exist
during the run time of that function. Each new run of the function creates
and initializes new local variables. When a local variable is declared with
the keyword static rather than new, the variable remains in existence after
the end of a function. This means that static local variables provide private,
permanent storage that is accessible only from a single function (or
compound block). Like global variables, static local variables can only be
initialized with constant expressions.
• Static global declarations
A static global variable behaves the same as a normal global variable, except
that its scope is restricted to the file that the declaration resides in. To
declare a global variable as static, replace the keyword new by static.
Reply


Messages In This Thread
Question about Scope - by LeNy - 06.01.2011, 10:54
Re: Question about Scope - by veyron - 06.01.2011, 11:12
Re: Question about Scope - by LeNy - 06.01.2011, 11:21

Forum Jump:


Users browsing this thread: 1 Guest(s)