Einzelnen Beitrag anzeigen

Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#5

Re: Anzahl der Eintragungen in einer Datei ermitteln.

  Alt 9. Feb 2004, 14:03
Was ist ein Element? Handlet es sich um eine typisierte datei kannst du die Anzahl der datensätze mit FileSize bestimmen.:
Zitat:
Call FileSize to determine the size of the file specified by the file variable F. The size is expressed as the number of records in a record file. Thus:

If the file is declared as a file of byte, then the record size defaults to one byte, and FileSize returns the number of bytes in the file.
The Reset procedure can set the record size (in bytes) when it opens the file. In this case, FileSize returns the number of records in the file.

Note: If the file is declared as an untyped file and you don’t specify a record size when you call Reset, then FileSize assumes a record size of 128. That is, FileSize gives the number of bytes divided by 128.

To use FileSize, the file must be open. If the file is empty, FileSize(F) returns 0.

Note: FileSize can't be used on a text file.
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat