AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Textdatei in Record Muster überführen

Ein Thema von mabstudent · begonnen am 12. Jan 2013 · letzter Beitrag vom 21. Jan 2013
 
Klaus01

Registriert seit: 30. Nov 2005
Ort: München
5.780 Beiträge
 
Delphi 10.4 Sydney
 
#19

AW: Textdatei in Record Muster überführen

  Alt 21. Jan 2013, 13:48
aus der Delphi Hilfe:

Zitat:
In Delphi code, 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 do not 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.
Delphi-Quellcode:
  rec_pos:=strtoint(edit1.text); //gewünschte Person aus Edit1 lesen
für Edit1 ein von 0..anz_recs
  assignfile(destfile, 'recadressen'); //record Datei öffnen
  reset(destfile);

  anz_recs:=filesize(destFile); //grenzt die Eingabemögl.
  label1.caption:=inttostr(anz_recs);

  seek(destfile, rec_pos); //an die gewünschte Stelle fahren und
  read(destfile, person); //Person x auslesen
  memo1.clear;
  memo1.lines.add(person.nachname+...); //hier folgen später die weiteren Eigenschaften
  closefile(destfile);
Grüße
Klaus
Klaus
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:12 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz