A tag mismatch
#5

You need to add a File tag to filehandle

Код:
stock INI_GetInt(File:filehandle, Key[], &dest) {

    new pos, line[MAX_FILE_STRING];
    
    while( fread(filehandle, line) ) {
    
        if( (pos = strfind(line, Key, false)) != -1 ) {//-1 would be not find
        
            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;
}
That should fix it
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)