unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 =
class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure String_Zaehler(s:
string;
var position:integer);
begin
position:=pos('
edit1.text',s);
end;
procedure zeichenanhaengen(
VAR s:
string);
begin
end;
procedure TForm1.Button1Click(Sender: TObject);
var
posi: integer;
dateiname,s:
string;
datei:textfile;
position:integer;
begin
if opendialog1.execute
then
begin
dateiname:=opendialog1.filename;
showmessage(dateiname);
ASSIGNFILE(datei,dateiname);
RESET(datei);
while not eof(datei)
do
begin
Readln(datei,s);
String_Zaehler(s,position);
label2.caption:=inttostr(position);
end;
end;
Closefile(datei);
end;
procedure TForm1.Label2Click(Sender: TObject);
begin
end;
end.