[File]: Reading all lines?
#3

if you look in dini.inc there is lots of examples of how to read a file or use file function
im a but rusty with it but i gutted dini_get to make this quickly
should print eack line of the file to the console (untested)
pawn Код:
public printfile(filename[]){
    new File:fohnd;
    new tmpres[MAX_STRING];
    fohnd=fopen(filename,io_read);//open file
    if (!fohnd) return 0;              //end if dosent exist
    while (fread(fohnd,tmpres)) { //read each line
        print(tmpres); //print line
    }
    fclose(fohnd);//close file
    return 1;
}
hope that helps
Reply


Messages In This Thread
[File]: Reading all lines? - by uZ1 - 08.10.2014, 04:25
Re: [File]: Reading all lines? - by Quickie - 08.10.2014, 04:37
Re: [File]: Reading all lines? - by (SF)Noobanatior - 08.10.2014, 04:46
Re: [File]: Reading all lines? - by YanLanger - 08.10.2014, 05:15
Re: [File]: Reading all lines? - by uZ1 - 08.10.2014, 15:38

Forum Jump:


Users browsing this thread: 1 Guest(s)