Ich habe eine software geschrieben die den Inhalt der Listview in Records speichert di werden später auf eine Datei gschrieben .txt leider kann ich di jezt nich laden ich null ahnung bin neu in diesem gebiet helft mir bitte
PHP-Code:
unit Unit1;

interface

uses
  Windows
MessagesSysUtilsVariantsClassesGraphicsControlsForms,
  
DialogsComCtrlsStdCtrls;

type
  TForm1 
= class(TForm)
    
ListView1TListView;
    
btnLadenTButton;
    
btnSpeichernTButton;
    
GroupBox1TGroupBox;
    
Edit1TEdit;
    
Label1TLabel;
    
Label2TLabel;
    
Label3TLabel;
    
Label4TLabel;
    
Edit2TEdit;
    
Edit3TEdit;
    
Edit4TEdit;
    
btnKspTButton;
    
Label5TLabel;
    
Edit5TEdit;
    
Label6TLabel;
    
Label7TLabel;
    
OpenDialog1TOpenDialog;
    
SaveDialog1TSaveDialog;
    
procedure btnKspClick(SenderTObject);
    
procedure btnSpeichernClick(SenderTObject);
    
procedure btnLadenClick(SenderTObject);



  private
    { Private 
declarations }
  public
    { Public 
declarations }
  
end;

  
type
  TMyRecord 
record
    name
vornameadresseplzortString[30];
  
end;



var
  
Form1TForm1;

  
implementation

{$R *.dfm}



procedure TForm1.btnKspClick(SenderTObject);
var
  
listitem:Tlistitem;
  
Kunden_anzahlInteger;

  
begin
  label7
.Caption :='Anzahl Kunden = ' IntToStr(ListView1.Items.Count);
  
ListItem:=TlistItem.Create(ListView1.Items);
  
ListItem.SubItems.Add(Edit1.text);
  
ListItem.SubItems.Add(Edit2.text);
  
ListItem.SubItems.Add(Edit3.text);
  
ListItem.SubItems.Add(Edit4.text);
  
ListItem.SubItems.Add(Edit5.text);
  
ListView1.Items.AddItem(ListItem);

  
Edit1.Text:='';
  
Edit2.Text:='';
  
Edit3.Text:='';
  
Edit4.Text:='';
  
Edit5.Text:='';
end;

procedure TForm1.btnSpeichernClick(SenderTObject);
var
  
MyRecordTMyRecord;
  
f:file of TMyRecord;
  
x:integer;
  
lItemTListItem;
begin
  assignfile
(f,'C:\Var.txt');
  
rewrite(f);
  
begin
  
for := 0 to ListView1.Items.Count-do
  
begin
    lItem 
:= ListView1.Items[x];

    
FillChar(MyRecordSizeOf(MyRecord), #0);

    
MyRecord.name := lItem.SubItems[0];
    
MyRecord.vorname := lItem.SubItems[1];
    
MyRecord.adresse := lItem.SubItems[2];
    
MyRecord.plz := lItem.SubItems[3];
    
MyRecord.ort := lItem.SubItems[4];
    
Write(f,MyRecord);
  
end;
  
closefile(f)
end;
end;

procedure TForm1.btnLadenClick(SenderTObject);
var
  
f:file of TMyRecord;
  
MyRecordTMyRecord;
  
lItemTListItem;
  
x:Integer;
begin
  assignfile
(f,'C:\Var.txt');
  
reset(f);
  for 
:= 0 to ListView1.Items.Count-do
  
begin
  read
(f,MyRecord);
    
lItem := ListView1.Items[x];

    
lItem.SubItems[0]:= MyRecord.name;
    
lItem.SubItems[0]:= MyRecord.vorname;
    
lItem.SubItems[0]:= MyRecord.adresse;
    
lItem.SubItems[0]:= MyRecord.plz;
    
lItem.SubItems[0]:= MyRecord.ort;
    
end;
  
closefile(f)
end;



  (*
assignfile(f,'C:\Var.txt');
  
reset(f);
  
repeat
    read
(f,MyRecord);
  
lItem.SubItems[0] := MyRecord.name ;
  
until eof(f);
  
closefile(f)
end;  *)

end