请问各位大虾:我现在有两个tstringlist我想对其进行比较,从而判断是否有相同的值,
例如:
tstringlist1 tstringlist2
1 1
2 5
6 7
我的要求是对这两个tstringlist进行判断,从而保证其中没有任何相同的值,请问该怎么实现比较好呢?
例如:
tstringlist1 tstringlist2
1 1
2 5
6 7
我的要求是对这两个tstringlist进行判断,从而保证其中没有任何相同的值,请问该怎么实现比较好呢?
解决方案 »
- DLL问题
- **************谁知道手指甲根部的月牙形白色的是什么东西,我每个指甲上都有,还很大,这是怎么回事,有点怕
- 求购DRP分销管理系统Delphi+SQLSERVER源码.....
- Wise打包问题?
- 远程数据库问题(access)
- corba问题,为什么会出现"Class not found:Files\borland\vbroker\jre\bin\jre.exe"
- 在相关联的表中,如何取同一条记录中其字段的值!
- 请问在Windows2000/Xp下面编的程序怎么兼容windows98/ME???
- 关于as的用法
- delphi4的 quickreport 和 report builder 那个更适合于中国人使用
- 如何取的机器的 hostid?
- 关于TCollection!
//功能描述: 检查两个TStringList中是否有相同的值
//入口参数:
// strlst1, strlst2 - 两个进行比较的TStringList
//出口参数:
// 函数返回值 - True表示有相同的值, False表示没有
var
iLoop : Integer;
begin
Result := False;
if strlst1.Count < strlst2.Count then
begin
for iLoop := 0 to strlst1.Count - 1 do
if strlst2.IndexOf(strlst1.Strings[iLoop]) >= 0 then
begin
Result := True;
break;
end
end
else begin
for iLoop := 0 to strlst2.Count - 1 do
if strlst1.IndexOf(strlst2.Strings[iLoop]) >= 0 then
begin
Result := True;
break;
end;
end;
end;