Raised This Month: $ Target: $400
 0% 

register_plugin, defines and constants.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 06-10-2014 , 16:39   Re: register_plugin, defines and constants.
Reply With Quote #10

Defines are replaced by the compiler's preprocessor before compilation. So example 1 and 2 are *exactly* the same in the end. Using defines you can get that info to the top of the file for convenience, and update multiple occurances of the same string with ease.

Using a global const variable is helpful because the AMXX compiler is not clever enough to collapse usages of the same string literal into one. So if you write "1.0.0" as your version string ten times in your plugin (or use an equivalent define) it will actually end up ten times in the file.
__________________
In Flames we trust!
Nextra is offline
 



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 09:44.


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