Switch Statements And OnDialogResponse
#1

(EDIT): I've found an issue caused and linked to declaring several new variables on a same line.

The following code (for example) will compile just fine:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            new string[128];
            return 1;
        }
        case 2:
        {
            new string[128];
            return 1;
        }
    }
    return 1;
}
However when changed to...

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            new DB:database, DBResult:result[2], dialog[1650], string[128], value[2][64], placeholder[3], target, time;
            return 1;
        }
        case 2:
        {
            new string[128];
            return 1;
        }
    }
    return 1;
}
The error:

Код:
error 021: symbol already defined: "string"
Will appear, all because I made several new variables along with "new string[128]".
Reply


Messages In This Thread
Switch Statements And Variables (Error Produced) - by DrakeX - 12.06.2014, 23:02
Re: Switch Statements And OnDialogResponse - by Jefff - 12.06.2014, 23:14
Re: Switch Statements And OnDialogResponse - by DrakeX - 12.06.2014, 23:16
Re: Switch Statements And OnDialogResponse - by DrakeX - 13.06.2014, 00:32
Re: Switch Statements And OnDialogResponse - by DrakeX - 14.06.2014, 19:47
Re: Switch Statements And OnDialogResponse - by DrakeX - 15.06.2014, 16:46

Forum Jump:


Users browsing this thread: 2 Guest(s)