Function will return the number of records in a FileManager object opened file by using the file's file number to access the file.

 

Syntax:

iRecs = fileManager.CountLines( iFilNum )

 

Parameter:

Description:

iFilNum

The opened file-number integer value returned by the FileManager's Open methods.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VARIABLES: sFullPathFileName, sPathName, sFileName   Type: String
VARIABLES: iFilNum, iRecs                           Type: Integer
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Combine Path + "\" + File-Name into a Full Path-File statement
sFullPathFileName = sPathName + sFileName
 
'  If the file Exist, . . .
If FileExists( sFullPathFileName ) THEN
  '  Open File to obtain its File Number
  iFilNum = fileManager.OpenRead( sFullPathFileName )
  '  If a File number is assigned, . . .
  If iFilNum THEN
    '  Count the Records contained in the file
    iRecs = fileManager.CountLines(iFilNum)
  ENDIF '  iFilNum
ENDIF '  FileExists
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:

Number of records contained in the file.

 

Links:

FileExists, OpenAppend, OpenRead, OpenWrite

See Also:

FileManager, File & Disk Functions

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 233

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software