首页 > Windows开发 > 详细

第一个Delphi小程序

时间:2016-05-20 22:20:53      阅读:232      评论:0      收藏:0      [点我收藏+]

技术分享

第一次应工作需呀,接触这个语言,今晚在自己的电脑搭建好环境,写的第一个超简单的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;

 

第一个Delphi小程序

原文:http://www.cnblogs.com/shexunyu/p/5513510.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!