如何在close()后停止执行代码 [英] How to stop executing code after close()

查看:56
本文介绍了如何在close()后停止执行代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在调用close()后停止运行剩余的代码。检查条件并编写代码currentwindowobject(this.close())来关闭窗口。



问题是即使窗口在this.close()执行后关闭代码,所以它会创建一个异常

I need to stop running of remaining code after calling close(). Am checking a condition and wrote the code currentwindowobject(this.close()) to close the window.

The issue is even though the window is closing the code after this.close() is executing so it creates an exception

推荐答案

您必须在 Close()之后添加 return ,如下一个示例所示:

You have to add a return after Close() like in the next example:
if(yourCodition)<br />
{<br />
   this.Close();<br />
   return;<br />
}


这篇关于如何在close()后停止执行代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆