怎么判断delphi的memo中有重复数据的行
1个回答
展开全部
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
sar:array[1..1000] of string;
i,n:integer;
begin
n:=memo1.Lines.Count;
for i:=1 to n do sar[i]:=memo1.Lines.Strings[i-1];
for i:=2 to n do if sar[i]=sar[i-1] then showmessage('有相邻的重复行');
end;
end.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询