AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   static functions? (https://forums.alliedmods.net/showthread.php?t=84602)

diamond-optic 01-28-2009 17:47

static functions?
 
im a little curious about this as ive seen them used every now and then..

what the difference in using static instead of public, or even in comparison to stock or when theres just a function name with nothing before it...

public func_whatever()
static func_whatever()
stock func_whatever()
func_whatever()

ive never really understood the 'true' difference between them and id like to get an educated response onto benefits of one over the other and what situations specific ones are best used for..

Arkshine 01-28-2009 18:04

Re: static functions?
 
The pawn guide says :
Quote:

When the function name is prefixed with the keyword static, the scope of the function is restricted to the file that the function resides in.
It seems like a private function. static func_whatever() or func_whatever() should be the same, if I'm right.

Public is used from forward or callback function.

Well read the pawn guide for more informations.

diamond-optic 01-28-2009 19:29

Re: static functions?
 
yeah i probably should have dug out the guide and looked thru that 1st.. tho quite often the wording in the guide can be a little confusing for me to comprehend lol

thanks!


All times are GMT -4. The time now is 01:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.