fread problems
#2

Yep, tried that. Strings were cut right. Edited the code a bit
pawn Код:
do
            {
                i++;
                format(path, 68, "/%s/%i.txt", dini_path, i);
                if(fexist(path))
                {
                    ID[count] = i;
                    count++;
                    exists = true;
                    new File:report = fopen(path, io_read);
                    while(fread(report, string))
                    {
                        if(strfind(string, "subject", true) != -1) { strdel(string, 0, 8); subject = string; }
                        if(strfind(string, "time", true) != -1) {  strdel(string, 0, 5);date = string; }
                        if(strfind(string, "reason", true) != -1) { strdel(string, 0, 7); reason = string; }
                        if(strfind(string, "read", true) != -1) { strdel(string, 0, 5); read = strval(string); }
                    }
                    if(read) format(cat, 68, "{ED9E15}%s {FFFFFF}%s: %s\n", date, subject, reason);
                    else format(cat, 68,"{ED9E15}%s {ED1515}%s: %s\n", date, subject, reason);
                    strcat(msg, cat);
                    fclose(report);
                }
            }
            while(i<50);
One problem is fixed now: There aren't any longer about 40 entries in the listbox (I formated the whole line in the while-loop). But now I have another problem: After every string is still a \n, which makes every variable appear in a new line, like this:
24.02.2012 15:59 -
Padarom
: Hack
23.02.2012 13:41 -
Mike
: Abuse

instead of
24.02.2012 15:59 - Padarom: Hack
23.02.2012 13:41 - Mike: Abuse
Reply


Messages In This Thread
fread problems - by Padarom - 24.02.2012, 12:53
AW: fread problems - by Padarom - 24.02.2012, 13:57
AW: fread problems - by Padarom - 24.02.2012, 15:23
AW: fread problems - by Padarom - 24.02.2012, 15:39
AW: fread problems - by Padarom - 24.02.2012, 16:04
AW: fread problems - by Padarom - 24.02.2012, 17:38

Forum Jump:


Users browsing this thread: 2 Guest(s)