|
@@ -388,39 +388,32 @@ procedure TrmWeiWuZjjlGatherData.WriteData;
|
|
|
if ACount < 10 then
|
|
|
Result := '-%d'
|
|
|
else if ACount < 100 then
|
|
|
- REsult := '-%2d'
|
|
|
+ REsult := '-%.2d'
|
|
|
else if ACount < 1000 then
|
|
|
- Result := '-%3d'
|
|
|
+ Result := '-%.3d'
|
|
|
else if ACount < 10000 then
|
|
|
- Result := '-%4d'
|
|
|
+ Result := '-%.4d'
|
|
|
else if ACount < 100000 then
|
|
|
- Result := '-%5d';
|
|
|
- end;
|
|
|
-
|
|
|
- function GetFormatStr(AIndex: Integer; const sFormat: string): string;
|
|
|
- begin
|
|
|
- Result := Format(sFormat, [AIndex]);
|
|
|
- Result := StringReplace(Result, ' ', '0', [rfReplaceAll]);
|
|
|
+ Result := '-%.5d';
|
|
|
end;
|
|
|
|
|
|
var
|
|
|
i: Integer;
|
|
|
vZ: TZjjl;
|
|
|
- sPre, sCode, sFormat: String;
|
|
|
+ sFormat: String;
|
|
|
begin
|
|
|
cdsZjjl.Active := True;
|
|
|
cdsZjjl.EmptyDataSet;
|
|
|
if FPreText <> '' then
|
|
|
- sPre := FPreText + GetFormatStr(FPhaseIndex, '-%02d')
|
|
|
+ sFormat := FPreText + Format('-%.2d', [FPhaseIndex]) + GetCodeFormat(FZjjlList.Count)
|
|
|
else
|
|
|
- sPre := FPreText + GetFormatStr(FPhaseIndex, '%02d');
|
|
|
- sFormat := GetCodeFormat(FZjjlList.Count);
|
|
|
+ sFormat := FPreText + Format('%.2d', [FPhaseIndex]) + GetCodeFormat(FZjjlList.Count);
|
|
|
for i := 0 to FZjjlList.Count - 1 do
|
|
|
begin
|
|
|
vZ := TZjjl(FZjjlList.Items[i]);
|
|
|
|
|
|
cdsZjjl.Append;
|
|
|
- cdsZjjlCode.AsString := sPre + GetFormatStr(i+1, sFormat);
|
|
|
+ cdsZjjlCode.AsString := Format(sFormat, [i+1]);
|
|
|
cdsZjjlCertificateCode.AsString := vZ.FCertificateCode;
|
|
|
cdsZjjlBGLCode.AsString := vZ.FBGLCode;
|
|
|
cdsZjjlPegName.AsString := vZ.FPegName;
|