主题:一个小问题
procedure TForm1.BitBtn1Click(Sender: TObject);
var
s,m: String;
i: integer;
begin
s:= 'PH'+ FormatDateTime('yyyymmdd',Now());
With Query1 do
begin
Close;
SQL.Clear;
SQL.Add('select max(bh) as ss From hwmc ');
Open;
end;
If Query1.FieldByName('ss').Value = null then
s := s + '001'
else
begin
m:= Trim(Query1.FieldByName('ss').Value) ;
i:= StrToInt(Trim(Copy(m,11,5))) ;
if (0>i) andi <10 then
s:= s + '00'+ InttoStr(i +1)
else if (i <10O) and (i<100) then
s:= s + '0'+ InttoStr(i +1)
else
s:= s +InttoStr(i +1);
end;
Label7.Caption := s;
这个程序怎么就能自加到10个啊 然后就不加了.怎么个问题啊??/谢谢
var
s,m: String;
i: integer;
begin
s:= 'PH'+ FormatDateTime('yyyymmdd',Now());
With Query1 do
begin
Close;
SQL.Clear;
SQL.Add('select max(bh) as ss From hwmc ');
Open;
end;
If Query1.FieldByName('ss').Value = null then
s := s + '001'
else
begin
m:= Trim(Query1.FieldByName('ss').Value) ;
i:= StrToInt(Trim(Copy(m,11,5))) ;
if (0>i) andi <10 then
s:= s + '00'+ InttoStr(i +1)
else if (i <10O) and (i<100) then
s:= s + '0'+ InttoStr(i +1)
else
s:= s +InttoStr(i +1);
end;
Label7.Caption := s;
这个程序怎么就能自加到10个啊 然后就不加了.怎么个问题啊??/谢谢