些函数可用。呵呵。 procedure SearchByPYIndexStr(Const SourceStrs:TStringList;Const PYIndexStr:string;Const IType:Integer; Box:TListBox); label NotFound; var i, j :integer; hzchar :string; begin box.Items.Clear; for i:=0 to SourceStrs.Count-1 do begin for j:=1 to Length(PYIndexStr) do begin if Length(SourceStrs[i])=0 then goto NotFound; hzchar:=SourceStrs[i][j]; if PYIndexStr[j] <> hzchar then goto NotFound; end; if (IType=0)or((IType=1)and(codes[integer(sourcestrs.Objects[i])][1]='*'))or((IType=2)and(codes[integer(sourcestrs.Objects[i])][1]='^')) then box.Items.Addobject(SourceStrs[i],sourcestrs.Objects[i]); NotFound: end; end;
procedure SearchByPYIndexStr(Const SourceStrs:TStringList;Const PYIndexStr:string;Const IType:Integer; Box:TListBox);
label NotFound;
var
i, j :integer;
hzchar :string;
begin
box.Items.Clear;
for i:=0 to SourceStrs.Count-1 do
begin
for j:=1 to Length(PYIndexStr) do
begin
if Length(SourceStrs[i])=0 then goto NotFound;
hzchar:=SourceStrs[i][j];
if PYIndexStr[j] <> hzchar
then goto NotFound;
end;
if (IType=0)or((IType=1)and(codes[integer(sourcestrs.Objects[i])][1]='*'))or((IType=2)and(codes[integer(sourcestrs.Objects[i])][1]='^')) then
box.Items.Addobject(SourceStrs[i],sourcestrs.Objects[i]);
NotFound:
end;
end;