try ....(需要执行的代码) except on e:exception do application.MessageBox(pchar(e.Message), '错误提示', 0); end;