Added in 1.9.0

$lines(filename)

Returns the total number of lines in the specified text file.

Parameters

Parameter Description
filename Filename to read from.

Example

;Open a file for writing
/fopen file file.txt

;Write a line to the file
/fwrite file Hello World

;Close the file
/fclose file

;Print the number of lines in file.txt
//echo -ag $lines(file.txt)
<pre>