A tag mismatch
#4

Yep.

Function where I'm getting the tag mismatch:
pawn Код:
stock INI_GetInt(filehandle, Key[], &dest) {

    new pos, line[MAX_FILE_STRING];
   
    while( fread(filehandle, line) ) {
   
        if( (pos = strfind(line, Key, false)) != -1 ) {//-1 would be not found
       
            new idx = pos + strlen(Key) + 1;
           
            if(line[idx] == ' ') {//the value is nothing
           
                idx = pos + strlen(Key) + 2;//if the = sign is further across
               
                if(idx > strlen(line)) return -1; //there was no value found
               
                dest = (idx < sizeof(line)) ? strval(line[idx]) : 0;
                return 1;
            }
           
            dest = (idx < sizeof(line)) ? strval(line[idx]) : 0;
            return 1;
        }
   
    }
    return 0;
}
how i'm testing it:

pawn Код:
new File:Myfile = fopen("MyFile.ini", io_read), myscore;
INI_GetInt(Myfile, "score", myscore);
fclose(Myfile);
Reply


Messages In This Thread
A tag mismatch - by thefatshizms - 12.04.2013, 17:46
Re: A tag mismatch - by KingHual - 12.04.2013, 17:54
Re: A tag mismatch - by FunnyBear - 12.04.2013, 17:56
Re: A tag mismatch - by thefatshizms - 12.04.2013, 17:57
Re: A tag mismatch - by KingHual - 12.04.2013, 17:58
Re: A tag mismatch - by FunnyBear - 12.04.2013, 17:59
Re: A tag mismatch - by thefatshizms - 12.04.2013, 18:00

Forum Jump:


Users browsing this thread: 1 Guest(s)