Visual Basic函数中的错误控制举例如下: Sub DoSomething On error goto ErrHandler < -- (VB错误控制语句) code.....code .... code .... If an error occurs in this section the control is automatically transferred to the ErrHandler section below. code.....code .... code .... ErrHandler: All errors come here and hence this section can be used to handle errors PReventing the user from seeing them. End Sub