[Tool/Web/Other] #define a 10 | public cmd_a+1 | public cmd_a+2 | - NOW POSSIBLE! - [beta] - Gamer_Z's PawnPreProcessor | v0.1
#8

Quote:
Originally Posted by Vince
View Post
It calculates the value of TEST_x (defined 100) plus 1 and then converts the whole thing to a string or something. However, I don't see any usefulness in this either. If Gamer_Z can provide me with a real world example to demonstrate its true usefulness (i.e. something that can't be done with the current preprocessor directives), I might come back on my opinion.
pawn Code:
#include <fdialog>
#adder MyFDialogIDBase 100

fDialog(MyFDialogIDBase+1)
{
    if(!response)return 1;
    ShowPlayerDialog(
        playerid,
        MyFDialogIDBase+2,
        DIALOG_STYLE_INPUT,
        "Registration",
        "Please provide an password for your account:",
        "Check",
        "Abort"
    );
    return 1;
}

fDialog(MyFDialogIDBase+2)
{
    if(!response)return 1;
    new strlenv = strlen(inputtext);
    if(strlenv > 90 || strlenv < 6)
    {
        ShowPlayerDialog(
            playerid,
            MyFDialogIDBase+2,
            DIALOG_STYLE_INPUT,
            "Registration",
            "Your password should be between 6 and 90 characters long!",
            "Check",
            "Abort"
        );
        return 1;
    }

    format(AUTHREG[playerid][Password],90,"%s",inputtext);

    ShowPlayerDialog(
        playerid,
        MyFDialogIDBase+3,
        DIALOG_STYLE_INPUT,
        "Registration",
        "Please provide your E-Mail adres for password recovery:",
        "Next",
        "Abort"
    );
    return 1;
}
With the normal compiler it isn't possible when you change "adder" to "define"

output:
pawn Code:
#include <fdialog>


fDialog(101)
{
    if(!response)return 1;
    ShowPlayerDialog(
        playerid,
        102,
        DIALOG_STYLE_INPUT,
        "Registration",
        "Please provide an password for your account:",
        "Check",
        "Abort"
    );
    return 1;
}

fDialog(102)
{
    if(!response)return 1;
    new strlenv = strlen(inputtext);
    if(strlenv > 90 || strlenv < 6)
    {
        ShowPlayerDialog(
            playerid,
            102,
            DIALOG_STYLE_INPUT,
            "Registration",
            "Your password should be between 6 and 90 characters long!",
            "Check",
            "Abort"
        );
        return 1;
    }

    format(AUTHREG[playerid][Password],90,"%s",inputtext);

    ShowPlayerDialog(
        playerid,
        103,
        DIALOG_STYLE_INPUT,
        "Registration",
        "Please provide your E-Mail adres for password recovery:",
        "Next",
        "Abort"
    );
    return 1;
}
Quote:
Originally Posted by CaHbKo
View Post
I don't understand how "cmd_TEST_ + 1" suddenly becomes "cmdb_101". Where the heck that 'b' comes from?

Gamer_Z, unless the purpose of a tool is obvious, you gotta include some description.
that was a little mistake.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)