各位大虾:)小弟学习delphi不是很久,今天看到halt这个函数,在帮助文档中还有关于它的解释,但是还不是很明白。现在我想知道的是terminate,exit,halt,close……或者还有别的什么结束函数,它们之间有什么区别和联系啊??求教ing~~~~~~~~~~~还有在halt的帮助中的解释:
To perform a normal termination of a Delphi application, call the Terminate method on the global Application object. If the application does not use a unit that provides an Application object, call the Exit procedure from the main Program block.
其中If the application does not use a unit that provides an Application object……说的是什么情况啊??小弟初学乍炼,请各位大虾不吝赐教~~~~~~
To perform a normal termination of a Delphi application, call the Terminate method on the global Application object. If the application does not use a unit that provides an Application object, call the Exit procedure from the main Program block.
其中If the application does not use a unit that provides an Application object……说的是什么情况啊??小弟初学乍炼,请各位大虾不吝赐教~~~~~~
正常关闭应用程序,即按顺序释放资源. 用Application.terminate.
exit 退出正在执行的过程.
close关闭当前窗体.
Abort 退出当前过程并触发异常,而exit只是退出过程不触发异常例如
看看就知道了procedure TForm1.Button1Click(Sender: TObject);
begin
try
if 1=1 then
begin
Abort;
showmessage('1');
end;
except
showmessage('异常');
end;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
try
if 1=1 then
begin
Exit;
showmessage('1');
end;
except
showmessage('异常');
end;
end;
说的没错