Try 
  ...
Except
  //产即结束整个应用程序?
End;以上问题处该怎么写呢,我试过:Application.Destroy;Application.Free等,都不能达到效果,我将MainForm.Close了,但是程序好像还是要执行一些什么代码后才关闭。

解决方案 »

  1.   

    Try 
      ...
    Except
     Application.Terminate;
    End;
    注意,异常要在delphi以外的环境才能被捕获。
      

  2.   

    Application.Terminate;
    还是不行,还是要断续执行一些代码,比如Form上的控件初始化代码
      

  3.   

    在工程文件里加入intialition(这个关键子记的不是很清楚啊!见谅!!!)试试看。
    就是对代码初始化。
      

  4.   

    halt?
    是什么意思啊?没弄明白耶?
      

  5.   

    Initiates abnormal termination of a program.UnitSystemCategoryflow control routinesDelphi syntax:procedure Halt [ ( Exitcode: Integer) ];DescriptionHalt performs an abnormal termination of a program and returns to the operating system. 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.Exitcode is an optional expression that specifies an exit code for the program.
      

  6.   

    Try 
      ...
    Except
    begin
     Application.Terminate;
     exit;//加入此句,决绝你的代码继续往下执行的困扰
    end;
    End;
      

  7.   

    楼主,千万别信 huiwww(十足菜鸟) 的,那样编译都通不过的^_^
    信我的没错,Delphi 7 通过的。
      

  8.   

    向 huiwww(十足菜鸟) 严重道歉,那个方法也可以~~是我记错了 ^_^