The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: [1] function CountLinesInTextFile (const FVar: TextFile; FeedBack: TFeedbackProc): integer;
[2] function CountLinesInTextFile (const FName: string; FeedBack: TFeedbackProc): integer;

The function CountLinesInTextFile counts the number of lines in the text file specified by FVar or FName. Version [1] requires an open text file, the file pointer is reset by the function. In the case of version [2] the file is opened (and closed) using the filename FName. In order to provide feedback when reading large files a callback routine can be assigned to the parameter FeedBack. The callback routine is called after every 1000 lines.

Last Update: 2017-Jul-15