例如你取出了最大值存放在MAXVALUE(string)中,可以做如下处理:var
Max : integer;Max := strtoint(MaxValue) + 1;
MaxValue := inttostr(Max);case length(MaxValue) of
1: MaxValue:='0000' + Maxvalue;
2: MaxValue:='000' + Maxvalue;
3: MaxValue:='00'+Maxvalue;
4: MaxValue:='0'+Maxvalue;
5: MaxValue:=Maxvalue;
end;
edit_djbh.text:=MaxValue;
Max : integer;Max := strtoint(MaxValue) + 1;
MaxValue := inttostr(Max);case length(MaxValue) of
1: MaxValue:='0000' + Maxvalue;
2: MaxValue:='000' + Maxvalue;
3: MaxValue:='00'+Maxvalue;
4: MaxValue:='0'+Maxvalue;
5: MaxValue:=Maxvalue;
end;
edit_djbh.text:=MaxValue;
function tdata1.makefphm(s :string):string;
var s2 : string;
i: integer;
begin
i:=StrToInt(s);
s2:=IntToStr(i+1);
s2:=Copy('0000000',1,7-Length(IntToStr(StrToInt(s)+1)))+s2;
result:=s2;
end;