LineCount

Parent Previous Next

LineCount

Function to read the line of file in memory.


Syntax:

int LineCount():
The function returns the numbers of the line file in memory.


Return:

       int: returns the numbers of the line file in memory.


Example:

In this example, we are trying to open the file "OpenFunction.txt" located in the path "C:\" and overwriting the existing content of the file. If the file is opened successfully the user will count the lines in the file and print the result.

  


@OpenFileSuccessfully = SVFile.Open("C:\OpenFunction.txt", true);

if(@OpenFileSuccessfully == true )

{

int count = SVFile.LineCount();

SVApplications.Output("Line Count: " count);

}

else

SVApplications.Output("File could not be opened");

 


If the file is opened successfully the result in the "OpenFunction.txt" file will be:


File

open

successfully