file_text_readln

Goes to the next line of the text file

Syntax:

file_text_readln(fileid);


Argument Description
fileid The id of the file to read from.


Returns: string


Description

With this function you can skip the remainder of the current line from a given opened text file and move to the start of the next one. The function will also return the full line as a string, making it an easy way to read complete "chunks" of data for parsing later.


Example:

var i, file;
file = file_text_open_read(working_directory + "\hiscore.txt");
for (i = 0; i < 10; i += 1)
   {
   scr[i] = file_text_read_real(file);
   file_text_readln(file);
   scr_name[i] = file_text_read_string(file);
   file_text_readln(file);
   }
file_text_close(file);

The above code opens a file for reading and then loops through the lines of the file reading alternately a real number value and a string into two different arrays for future use. The file is then closed when the loop has finished.


Back: Text Files
Next: file_text_write_real
© Copyright YoYo Games Ltd. 2018 All Rights Reserved