Define function help ...
#3

I HIGHLY encourage you read the PAWN Pre-Processor tutorial written by ******.

Quote:
Originally Posted by ******
So why use macros instead of functions (or why use functions instead of macros)? Macros replace text - so wherever you put the macro, there will your replacement go. If you have a macro in your code 100 times, that code will get generated 100 times. On the other hand if you have a function in your code 100 times, its code will only appear once with 100 calls to it. The latter is probably preferable if you have a lot of code - large chunks of code appearing 100 times will make a very large AMX file! Macros tend to be used for very small bits of code - calling a function takes time, so if you have very tiny code it's not really worth the effort of calling a function, but this is not a rule! If you used a function instead of the macros above, the code compiled would look like:
Reply


Messages In This Thread
Define function help ... - by Edvin - 10.05.2012, 13:37
Re: Define function help ... - by Edvin - 10.05.2012, 15:22
Re: Define function help ... - by Disturn - 10.05.2012, 16:09

Forum Jump:


Users browsing this thread: 1 Guest(s)