第一个Delphi小程序

第一次应工作需呀,接触这个语言,今晚在自己的电脑搭建好环境,写的第一个超简单的Delphi小程序!

var
  temp:Integer;

//求个位数
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  temp := StrToInt(Edit1.Text);
  Label1.Caption := IntToStr(temp Mod 10);
end;

//十位数
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
  temp := StrToInt(Edit1.Text);
  Label2.Caption := IntToStr(temp Mod 100 Div 10);
end;

procedure TForm1.BitBtn3Click(Sender: TObject);
begin
  temp := StrToInt(Edit1.Text);
  Label3.Caption := IntToStr(temp Mod 1000 Div 100);
end;

procedure TForm1.BitBtn4Click(Sender: TObject);
begin
  temp := StrToInt(Edit1.Text);
  Label4.Caption := IntToStr(temp Mod 10000 Div 1000);
end;
原文地址:https://www.cnblogs.com/shexunyu/p/5513510.html