Raised This Month: $ Target: $400
 0% 

static functions?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
diamond-optic
Veteran Member
Join Date: May 2005
Old 01-28-2009 , 17:47   static functions?
Reply With Quote #1

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..
__________________
diamond-optic is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-28-2009 , 18:04   Re: static functions?
Reply With Quote #2

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.

Last edited by Arkshine; 01-28-2009 at 18:13.
Arkshine is offline
diamond-optic
Veteran Member
Join Date: May 2005
Old 01-28-2009 , 19:29   Re: static functions?
Reply With Quote #3

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!
__________________
diamond-optic is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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