InvoiceStartNo:=EdtBlankStart.Text;
TempNo:=IntToStr(StartINVNo+INVNumber-1);
InvoiceEndNo:=Copy('00000000',1,8-Length(tempNo))+tempNo;现在的invoiceno是8位的,知道了invnumber,也就是数量,算出InvoiceEndNo,现在要求是invoiceno
位数是10位之内,该怎么求?谢谢大家!我是新人,表笑我!
TempNo:=IntToStr(StartINVNo+INVNumber-1);
InvoiceEndNo:=Copy('00000000',1,8-Length(tempNo))+tempNo;现在的invoiceno是8位的,知道了invnumber,也就是数量,算出InvoiceEndNo,现在要求是invoiceno
位数是10位之内,该怎么求?谢谢大家!我是新人,表笑我!
因为InvoiceStartNo和InvoiceEndNo都是8位的,所以用上边的计算可以,但是现在改成10位之内了,该怎么做?
StartINVNo又是什么呢?
可以吗?
// FillZero(): To use the specified length to complete a string with a
// parameter value;
// For example: (1) AValue = 3, ALength = 5,
// and the function result will be '00003';
// (2) AValue = 11, ALength = 2, Result = '11';function FillZero(AValue: Integer; ALength: Integer): string;
var
i: Integer;
begin
Result := IntToStr(AValue);
for i := ALength downto Length(Result) + 1 do
Result := '0' + Result;
end;