Explain "fread"?
#4

Here, I've just written this function for you to make it easier (put it at the end of the script (to make it easy)):
pawn Код:
freadLine(File: handle, line)
{
    new
        string[128]
    ;
    for(new x; x != line; x++)
    {
        fread(handle, string);
    }
    return string;
}
Example/Usage:
This function returns the info on the line you defined.

Example:
pawn Код:
new
    File: file = fopen("test.txt", io_read)
;
printf("%s", freadLine(file, 23));
This will give us all info which is on line 23. Just change the line to get other info.

Other questions about this let it know.
Reply


Messages In This Thread
Explain "fread"? - by Ash. - 07.08.2010, 17:29
Re: Explain "fread"? - by RyDeR` - 07.08.2010, 17:50
Re: Explain "fread"? - by Ash. - 07.08.2010, 18:00
Re: Explain "fread"? - by RyDeR` - 07.08.2010, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)