View Single Post
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 07-28-2012 , 16:04   Re: [TUT] Code Styling & Good Programming Habits
Reply With Quote #83

Quote:
Originally Posted by ConnorMcLeod View Post
Macros with commas work well, you can't put spaces in them that's all.

See :

PHP Code:
#define m_iMenu 205
#define cs_get_user_menu(%0)     get_pdata_int(%0, m_iMenu)
#define cs_set_user_menu(%0,%1)  set_pdata_int(%0, m_iMenu, %1) 
OH! It wasn't working for me when i did SET_DATA(%1, %2) but worked without the comma. whatever reason....my code compiles and works properly. Though i, personally, prefer using the commas. So i think i'ma switch back to that in my code.

Also note: you need to keep the same delimiter throughout your code.
If you were to choose SET_DATA(%1,%2) you would not be able to call it with SET_DATA(%1 %2)
and same goes the other way around.
__________________
What an elegant solution to a problem that doesn't need solving....

Last edited by Liverwiz; 07-28-2012 at 16:08.
Liverwiz is offline