FileReadLine()

Reads the current line from an open file (see FileOpen()) and moves the current line pointer of the file to the next line.

FileReadLine( file=any );

Returns: String

Argument Description
file
any, required

The file object

Alias: source, filepath, fileObj

Examples

// Example reads lines of file one at a time into an array
filePath = "/path/to/file.txt"
openFile = fileopen( filePath, "read" );
lines = [];

// IMPORTANT: must close file, use try/catch/finally to do so try { while( !fileIsEoF( openFile ) ) { arrayAppend( lines, fileReadLine( openFile ) ); } } catch( any e ) { rethrow; } finally { fileClose( openFile ); }

See also