16,748
社区成员
发帖
与我相关
我的任务
分享
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
S:string;
L:integer;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
S:='001002';
L:=0;
end;
procedure TForm1.Button1Click(Sender: TObject);
var S1:string;
begin
L:=L+1;
S1:=IntTostr(L);
while Length(S1)<3 do
S1:='0'+S1;
Edit1.text:=S+S1;
end;
end.
x:='001002001';
x:=copy(x,1,6)+copy(IntToStr(StrToInt(copy(x,7,3))+1+1000),2,3);