
02.05.2008, 07:02
|
Прохожий
|
|
Регистрация: 01.05.2008
Сообщения: 10
Репутация: 10
|
|
вобщем я вот так сделал. Думаю тему можно закрывать:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
function ListContained(st: string; StList: TStrings): boolean;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function Tform1.ListContained(st: string; StList: TStrings): boolean;
var
i: longint;
begin
result := false;
for i := 0 to StList.Count - 1 do
if St = StList.Strings[i] then
begin
result := true;
break
end
end;
procedure TForm1.Button1Click(Sender: TObject);
var
ss:boolean;
a:string;
begin
a:=Edit1.Text;
ss:=ListContained(a, Memo1.Lines);
if ss=TRUE then
begin
Edit2.Text:='Yes';
end
Else Edit2.Text:='No';
end;
end.
|