Macro doesn't parse enum indexes
#1

Take a look at the following piece of code:

pawn Code:
#define dialog:%0(%1,%2,%3,%4) \
    forward DIALOG_%0(%1, %2, %3, %4); \
    public DIALOG_%0(%1, %2, %3, %4)

enum e_dialog_ids
{
    d_abc = 1,
    d_def,
    d_ghi,
    // ...
};

dialog:d_def(playerid, response, listitem, inputtext[])
{
    // ...
    return 1;
}
The result I expect is creation of a function named "DIALOG_2". Instead, it creates a function "DIALOG_d_def".


How do I make a macro to parse the given parameter as an enum index, not just a string?
Reply
#2

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)