file_text_read_real

With this function you can read a real number value from a text file and the function returns that value to be used or stored in a variable.

 

Syntax:

file_text_read_real(fileid);

ArgumentTypeDescription
fileidText File IDThe id of the file to read from.

 

Returns:

Real

 

Example:

var file = file_text_open_read(working_directory + "hiscore.txt");
for (var i = 0; i < 10; ++i;)
{
    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.