Einzelnen Beitrag anzeigen
Alt 16.10.2013, 23:54   #769 (permalink)
Tankbuster#
Newbie
 
Registriert seit: 12.08.2013
Beiträge: 45
Standard

Zitat von Xeno Beitrag anzeigen

A macro gets expanded in the preprocessing phase, compiling comes after that, and in case of FUNC(weaponcargo) it will be d_fnc_weaponcargo when the script gets actually compiled and then it's not the same as weaponcargo anymore.
Macros are always preprocessed before anything else happens.
A simple example, you can write #something which will expand to "something" during preprocessing.

Or check x_dlg\SquadManagement.hpp for a little bit more advanced macro usage (saves a lot of lines and together with __EXEC and __EVAL makes creating dialogs with a lot of controls, well, very easy).

Ah, I wondered when the macro is parsed. Now it makes sense that it's safe to have a macro and command use the same name.

Looking forward to was P version brings.
Tankbuster# ist offline