if tlist.Fields[0].AsString in ['TRYQCKZ_','TRYQCKZX'] then
begin
...
end;
照楼上说的做了,可是编译不通过
Build
[Error] bak.pas(56): Ordinal type required
[Error] bak.pas(56): Incompatible types: 'Integer' and 'String'
[Fatal Error] Pbak.dpr(5): Could not compile used unit 'bak.pas'
var
List:TStringList;
I:Integer;
va;string
//目的字符串
result:boolean;
begin
result:=False;
List:=TStringList.Create;
try
List.Add('字符串1');
.
.
.
List.Add('字符串n');
for I:=0 to List.Count-1 do
begin
if Comparestr(va,List)=0 then
begin
result:=True;
exit;
end;
end;
if result then
begin
...
end else
do elsesomthing;
finally
List.free;
end;
end;
好累啊,真不习惯这样写程序,嗬嗬!