delphi代码

来源:百度知道 编辑:UC知道 时间:2024/04/28 23:05:06
procedure TF_kcsp.getspbh(sender:Tobject); //得到商品编号
begin
adoquery1.Last;
if adoquery1.RecordCount=0 then
spbh:='T'+formatfloat('00000',1)
else
spbh:='T'+Formatfloat('00000',strtoint(copy(adoquery1.Fields[0].AsString,2,5))+1);
end;

帮忙解释一下谢谢

adoquery1.last 下一条记录
if adoquery.recordcount=0 then 如果记录数为0
spbh:='T'+formatfloat('00000',1) 格式化字符串
else 否则
spbh:='T'+Formatfloat('00000',strtoint(copy(adoquery1.fields[0].asstring,2,5))+1); 格式化记录字符串