unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm1 =
class(TForm)
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
RichEdit1: TRichEdit;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.LoadFromFile('
e:\wetter.txt');
end;
procedure TForm1.Button2Click(Sender: TObject);
var
s:
string;
i, j: Integer;
begin
Screen.Cursor := crHourGlass;
j := 0;
for i := 0
to Memo1.Lines.Count - 1
do
begin
s := Memo1.Lines[i];
if pos('
<div class="weather-current">', s) <> 0
then
begin
j := i;
//MessageBox(Handle, PChar(IntToStr(j)), 'Gefunden', mb_Ok or mb_IconStop or mb_DefButton1);
break;
end;
end;
Memo1.Lines.BeginUpdate;
for i := 1
to j
do
Memo1.Lines.Delete(0);
Memo1.Lines.EndUpdate;
Screen.Cursor := crDefault;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
RichEdit1.Lines.LoadFromFile('
e:\wetter.txt');
end;
procedure TForm1.Button4Click(Sender: TObject);
var
s:
string;
i, j: Integer;
begin
Screen.Cursor := crHourGlass;
j := 0;
for i := 0
to RichEdit1.Lines.Count - 1
do
begin
s := RichEdit1.Lines[i];
if pos('
<div class="weather-current">', s) <> 0
then
begin
j := i;
//MessageBox(Handle, PChar(IntToStr(j)), 'Gefunden', mb_Ok or mb_IconStop or mb_DefButton1);
break;
end;
end;
RichEdit1.Lines.BeginUpdate;
for i := 1
to j
do
Richedit1.Lines.Delete(0);
Richedit1.Lines.EndUpdate;
Screen.Cursor := crDefault;
end;
end.