public, private, and stock
#1

I've been using PAWN for about two years now and I still don't fully understand what they each mean.

I tried looking, but all I could find were Public and Private stock markets? lol, anyway:

So what does Public, Private, and Stock mean and what are they officially called?

Thanks,
ledzep
Reply
#2

I also noticed you can make a function without using private/public/stock/etc...
And you also won't need to make a forward declaration.

i.e.

Код:
Function()
{
  ...
}
In what ways would this be different than:


Код:
public Function()
{
  ...
}
?
Reply
#3

There are load of infos about public and stock prefixes in the Pawn manual and private isn't used in Pawn.

For SA:MP, a public function should only be a function that is called by a timer of by CallRemoteFunction. If this isn't the case, don't make it public.

The stock prefix is useful for include files with functions that may not be used in the main script. Compiler doesn't include the stock functions if they are not used anywhere in the script.
Reply
#4

emm,what's the differences
static var;
new var;
const var;
public var;
stock var;
new const (stock) var;
static const (stock) var;
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)