Raised This Month: $51 Target: $400
 12% 

@ in front of function?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 07-16-2014 , 10:53   @ in front of function?
Reply With Quote #1

What does @ mean in front of function?

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Compile me", "1.0", "Author" ); } @__CompileThisPlugin( ) { }

Code:
#include < amxmodx > public plugin_init( ) {     register_plugin( "Compile me", "1.0", "Author" ); } __CompileThisPlugin( ) { }

I guess that @ = public but i'm not sure, that's why i'm asking.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-16-2014 , 11:03   Re: @ in front of function?
Reply With Quote #2

It means nothing.
__________________
hleV is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-16-2014 , 12:15   Re: @ in front of function?
Reply With Quote #3

http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf

Last edited by HamletEagle; 07-16-2014 at 12:25.
HamletEagle is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-16-2014 , 13:20   Re: @ in front of function?
Reply With Quote #4

@ is a shorthand for public. It's supposed to be used on events for readability reasons.

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
set_task(1.0"@say")
}

@
say()
{
    
server_print("AAAAAAAAAAAAAAA")

Output: AAAAAAAAAAAAAAA
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 07-16-2014 at 13:47.
Backstabnoob is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 07-16-2014 , 14:43   Re: @ in front of function?
Reply With Quote #5

Quote:
Originally Posted by hleV View Post
It means nothing.
Compile those two plugins i posted and you'll see that compiler thinks different.

Quote:
Originally Posted by Backstabnoob View Post
@ is a shorthand for public. It's supposed to be used on events for readability reasons.

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
set_task(1.0"@say")
}

@
say()
{
    
server_print("AAAAAAAAAAAAAAA")

Output: AAAAAAAAAAAAAAA
Thanks, i was pretty sure that @ stands for public, but i never saw someone using it.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-16-2014 , 15:10   Re: @ in front of function?
Reply With Quote #6

It doesn't really matter, it's more of a readability option. Like I said, this should be explicitly used for event-related functions, such as forwards. You cannot use it for defined forwards though as @ becomes a part of the function name.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob 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 15:54.


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