unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
ExtCtrls, Grids, ComCtrls;
type
{ TmainFrm }
TmainFrm =
class(TForm)
Beenden: TButton;
Halle: TButton;
ListView1: TListView;
procedure BeendenClick(Sender: TObject);
procedure HalleClick(Sender: TObject);
private
public
end;
var
mainFrm: TmainFrm;
implementation
{$R *.lfm}
type
TStrArray =
array of string;
var
dateiname:
string;
function explode.....
end;
//procedure dateiladen(dateiname: string);
//end;
{ TmainFrm }
procedure TmainFrm.BeendenClick(Sender: TObject);
begin
application.terminate;
end;
procedure TmainFrm.HalleClick(Sender: TObject);
var
//ListView1: TListView;
list: TStringList;
listItem: TListItem;
x, ItemCount: Integer;
a: TStrArray;
begin
dateiname:='
C:\Users\pfad_dateiname';
list:=TStringList.Create;
list.Clear;
list.LoadFromFile(dateiname);
itemCount:=list.Count;
ListView1.Items.Clear;
for x:=0
to itemCount-1
do begin
Explode(a,'
;',list.Strings[x]);
listItem:=ListView1.Items.Add;
listItem.Caption:=a[0];
listItem.SubItems.Add(a[1]);
listItem.SubItems.Add(a[2]);
listItem.SubItems.Add(a[3]);
end;
list.free;
end;