strange problem
#1

code
pawn Код:
new strData[8][129];
sscanf(MySQL_Load, "p<|>s[24]s[129]s[16]", strData[0], strData[1], strData[2]);
errors
Код:
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23771) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23785) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23828) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23834) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23851) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23857) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23877) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23883) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User1\Desktop\Freeroam\gamemodes\MyGM.pwn(23900) : warning 219: local variable "MySQL_Load" shadows a variable at a preceding level
when i comment the code, it compile with no errors, so it have something to do with the code i posted
Reply
#2

no, 'string' is not a global varible, 'MySQL_Load' is not too, but now i know what cause to the problem, it is this

"new strData[8][129];" if i remove the [129] then it will looks like "new strData[8];" and then it works, but then the info will be stored as integer?

String:
new strData[8][129];

Interger
new strData[8];

correct me if im wrong
Reply
#3

yes im 100% sure i have no global 'string' and here is my set up

pawn Код:
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
    switch(resultid)
    {
        case 0:
        {
            new MySQL_Load[140]; //No error
            //other
        }
        case 1:
        {
            new MySQL_Load[155]; //No error
            //other
        }
        case 2:
        {
            new MySQL_Load[145]; //No error
            //other
        }
        case 3:
        {
            new MySQL_Load[561];
            new strData[8][129];
            sscanf(MySQL_Load, "p<|>s[24]s[129]s[16]", StringData[0], StringData[1], StringData[2]);
            //other
        }
        case 5:
        {
            new string[128]; //Error
            //other
        }
        case 6:
        {
            new MySQL_Load[150]; //Error
            //other
        }
        case 7:
        {
            new MySQL_Load[35]; //Error
            //other
        }
        case 8:
        {
            new string[128]; //Error
            //other
        }
        case 9:
        {
            new MySQL_Load[128]; //Error
            //other
        }
        case 10:
        {
            new string[150];
            //other
        }
        case 11:
        {
            new MySQL_Load[128];
            //other
        }
        case 12:
        {
            new string[128]; //Error
            //other
        }
        case 13:
        {
            new MySQL_Load[128]; //Error
            //other
        }
    }
    return 1;
}
Reply
#4

still, same just now i get same error with other name "newString"
Reply
#5

i did this instead

pawn Код:
new strData1[24], strData2[129], strData3[16];
sscanf(MySQL_Load, "p<|>s[24]s[129]s[16]", StringData1, StringData2, StringData3);
and now it works with no errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)