delphi如果要用case来判断某种商品的付款方式怎么做?可能有多种的付款方式,数据查的是A表

2025-05-06 20:02:14
推荐回答(1个)
回答1:

这样做,你可以修改一下,改成一个函数
var
strList:Tstringlist;
str1:string;
begin
str1:=edit1.text;
strList:=Tstringlist.Create;
strList.CommaText:='现金,刷卡,信用卡,抵价券,充值卡';
case strList.IndexOf(str1) of
0: showmessage('1类') ;
1..2: showmessage('2类') ;
else
showmessage('其他类') ;
end;
strList.Free;
end;