Skip to main content

Try Catch

Body
Visual Basic Programming has an Exception to handle errors and other exceptional events. As a programmer, it is the best way to use a try catch to deal with unhandled exceptions. Especially when your program has disrupted the normal flow of instructions. Syntax:

Try
    [ tryStatements ]
    [ Exit Try ]
[ Catch [ exception [ As type ] ] [ When expression ]
    [ catchStatements ]
    [ Exit Try ] ]
[ Catch ... ]
[ Finally
    [ finallyStatements ] ]
End Try
The main purpose of exceptions is to manage errors. Using visual basic, here’s the built in keywords : Try, Catch

Comments

Add new comment