while not table.eof do begin if func1(field1.asstring) then view.add(field1.asstring); table.next; end;
Table.Fields.field 是一个TList 类型
1.直接通过一个Sql语句 select * from table1 where 字段 like '%'+参数+'%' 2.利用循环 建立临时表table1 while not table.eof do begin if func1(参数) then begin Table1.add; Table1.fields[1].value=.. end; end; 其中func1函数可以这样写: funct1(fd:String,str:String) begin if pos(str,fd)>0 then result:=true else result:=false; end;
view是treeview还是listview?
begin
if func1(field1.asstring) then
view.add(field1.asstring);
table.next;
end;
select * from table1 where 字段 like '%'+参数+'%'
2.利用循环
建立临时表table1
while not table.eof do
begin
if func1(参数) then
begin
Table1.add;
Table1.fields[1].value=..
end;
end;
其中func1函数可以这样写:
funct1(fd:String,str:String)
begin
if pos(str,fd)>0 then result:=true else result:=false;
end;