VB一个主程序过程A中有子过程B,B中又有个C,在C中有错误处理,如有出错,则ABC全跳出,结束当前主程序,如何处理啊,exit只能是当前,goto又不能在过程外设置标号,请教高手。
解决方案 »
- 请问在VB中怎样实现,当点击一个按钮后关闭按钮所在的窗口,而另打开一个窗口。
- 安装VB的时候提示错误
- ListView或TreeView怎么使得其滚动条透明?
- datagrid垂直滚动条与添加记录问题
- 自己写了个程序,为什么打印预览的情形和打印机打出来的字符位置有点错位啊?
- 帮忙~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- VB中功能与VFP中的INKEY()函数、LASTKEY()函数相同的有没有?
- 请教如何读取Xml文件内容到数组
- 能否给我一些人工智能的例题?
- 怎样将字符串转换成长整型?
- 老是出系统消息
- vb 从地址中获取数据。
'调用过程b
if b=false then
'结束程序
else
'继续执行end ifend subprivate function b() as boolean
on error goto eL:
'以下完成任务
b=true
exit function
eL:
b=false
end function
erflag:exit sub
zhidingdifang:下一个程序
Sub Main()
on error goto errorhandleif not subprocedure1 then goto errorhandleron error goto 0
Exitpnt:
'代码清理
exit suberrorhandle:
'在文本文件记下错误或是使用MSGBOX提示错误
GOTO Exitpnt
END SUBFunction subprocedure1
on error goto errorhandleif not subprocedure2 then goto errorhandleron error goto 0
Exitpnt:
'代码清理
exit suberrorhandle:
'在文本文件记下错误
GOTO Exitpnt
end functionFunction subprocedure2()
on error goto errorhandledebug.print 1/0on error goto 0
Exitpnt:
'代码清理
exit suberrorhandle:
'在文本文件记下错误
GOTO Exitpnt
end function