各位大虾:)小弟学习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……说的是什么情况啊??小弟初学乍炼,请各位大虾不吝赐教~~~~~~

解决方案 »

  1.   

    halt强制性关闭应用程序. 可能有资源不释放.
    正常关闭应用程序,即按顺序释放资源. 用Application.terminate. 
    exit 退出正在执行的过程.
    close关闭当前窗体.
      

  2.   

    在补充个
    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;
      

  3.   

    wilowind(无风雪亦飘)
    说的没错
      

  4.   

    再问一下~~~是不是exit abort只是对于过程来说的,对于窗体没有什么作用。close只是针对于当前窗体,而terminate halt则是针对于我现在所正在编写的应用程序的啊?还有就是halt所占用的资源没有释放都有什么资源啊??能不能举个例子啊??不胜感激~~~~~