file.countLines

Syntax file.countLines (path)

Params path is a legal path name to the file whose lines you wish to count.

Action Counts the number of lines in the file identified by the parameter path.

Returns The number of lines in the file.

Examples file.countLines ("C:\\Program Files\\Frontier\\sample.txt")

   » 70

file.countLines ("System:System Folder:textfile")

   » 51

Notes The number of lines is equal to the number of carriage returns in the file.

This will work for a PC-format text file, which delimits lines with CR/LF pairs.

If you apply file.countLines to non-text files, Frontier does its best to count the lines (actually counting carriage returns) but the returned result is largely useless.

Discuss