IT SOLUTIONS
Your TECHNOLOGY partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Languages
-Collapse +Expand Categories
-Collapse +Expand VB.Net Guides
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesVB.NetCommands   

Exception Trapping (Cross Ref > Commands)

By Mike Prestwood

VB.Net versus C++: A side by side comparison between VB.Net and C++.

 
Statements
 

Common statements such as if statements, loops, etc.

Exception Trapping

[Other Languages] 

Languages Focus

A common usage of exception handling is to obtain and use resources in a "try-it" block, deal with any exceptions in an "exceptions" block, and release the resources in some kind of "final" block which executes whether or not any exceptions are trapped.

VB.Net:   Try...Catch...Finally

VB.Net uses a try...catch...finally statement to trap for errors.

Try
Catch
Finally
End Try
Syntax Example:
Try
Dim y As Integer = 0
y = 1 / y
Catch
MessageBox.Show("you cannot divide by zero")

End Try
C++:   try/catch
Syntax Example:
try {
  //Some code.
}
catch(AnError) {
  //Error code here.
}












-
  Load Time=1 seconds.
 
Print This
-
 
Have a question? Need our services? Contact us now.
--Mike Prestwood

Call: 916-726-5675

email: info@prestwood.com


-
 
Connect With Us...
PrestwoodBoards
Join Us!
Facebook
Like our page!
Twitter
Follow us!
LinkedIn
Join Group
YouTube
View channel.
Go ahead!   Use Us! Call: 916-726-5675 


©1995-2013 Prestwood IT Solutions.   [Security & Privacy]   Made in the U.S.A..   No H1-B.   No offshoring.