发生错误时如何重新运行我的程序 [Vb6]
发生错误时如何重新运行我的程序[Vb6]?
How to rerun my program when an error occurs [Vb6] ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发生错误时如何重新运行我的程序[Vb6]?
How to rerun my program when an error occurs [Vb6] ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
在 VB6 中,您可以选择通过启动表单或调用某些全局“主”例程(在项目设置中)来启动程序。选择后一个选项(全局主例程)。
在全局主例程中,将其设置为如下所示:
Resume
将在导致错误的同一行重新启动,并且由于实际上只有一行,因此它将始终加载相同的表单。这假设您有一个名为
frmMain
的主窗体,并且它可以成功通过Form_Load
子例程。In VB6 you have the option of starting a program by launching a form or by calling some global "Main" routine (in project settings). Select that latter option (global Main routine).
In your global main routine, make it something like this:
The
Resume
will restart at the same line that caused the error, and since there's really only one line, it will always load the same form.This assumes that you have a main form called
frmMain
and that it can get through theForm_Load
subroutine successfully.您还可以使用 Resume Next 继续处理下一条指令
You could also use Resume Next to continue processing the next instructions