合肥包河区发展:DELPHI问题

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 04:02:24
我要用WHILE语句在文本框里输出0123456789,写了下面代码错在哪呢
procedure TForm1.Button2Click(Sender: TObject);
var a:integer;
begin
a:=0;
while a<=9 do

edit1.Text:=edit1.Text+inttostr(a);
a:=a+1;

procedure TForm1.Button2Click(Sender: TObject);
var a: integer;
begin
a:=0;
while a<=9 do
begin
edit1.Text := edit1.Text + inttostr(a);
a := a + 1;
end;
end;

在delphi 中执行一个程序,可以使用函数WinExec。
UINT WinExec(
LPCSTR lpCmdLine, // address of command line
UINT uCmdShow // window style for new application
);
例如要执行ACDSee看图程序,代码如下:
WinExec(Pchar('C:\Program Files\ACDSee\ACDSee32.exe'),sw_ShowNormal);
当然,不止一个函数可执行外部程序。