# Function Reference

# _FileCountLines

Returns the number of lines in the specified file

#include <File.au3>
_FileCountLines ( $sFilePath )

## Parameters

$sFilePath | Path of the file to be read, or a file handle returned from FileOpen().

## Return Value

Success: | the number of lines in the file.
Failure: | 0 and sets the @error flag to non-zero.
@error: | 1 = Error opening specified file

## Remarks

It does not count a final @LF as a line.

## Example

    #include <File.au3>
    #include <MsgBoxConstants.au3>

    Local $iCountLines = _FileCountLines(@ScriptFullPath) ; Retrieve the number of lines in the current script.
    MsgBox($MB_SYSTEMMODAL, "", "There are " & $iCountLines & " lines in this file.")