Quick question #define
#9

I want to add on a bit further. A define is a preprocessor directive and a such may be placed anywhere you want. I tend to do this:

pawn Код:
public OnPlayerDataSaved(query[], index, extraid, connectionHandle)
{
    #define playerid index
   
    // Lots of code
    printf("[data] Playerid %d disconnected. Data was saved and variables were reset.", playerid);
   
    #undef playerid
    return 1;
}
Reply


Messages In This Thread
Quick question #define - by davve95 - 28.11.2011, 18:47
Re: Quick question #define - by SmiT - 28.11.2011, 18:49
Re: Quick question #define - by Sinc - 28.11.2011, 18:50
Re: Quick question #define - by Ash. - 28.11.2011, 18:51
Re: Quick question #define - by steki. - 28.11.2011, 18:52
Re: Quick question #define - by Sinc - 28.11.2011, 18:54
Re: Quick question #define - by Ash. - 28.11.2011, 18:57
Re: Quick question #define - by davve95 - 28.11.2011, 19:59
Re: Quick question #define - by Vince - 28.11.2011, 20:52
Re: Quick question #define - by AndreT - 28.11.2011, 21:00

Forum Jump:


Users browsing this thread: 2 Guest(s)