how to make error handling

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

how to make error handling

 
0
  #1
Dec 16th, 2007
hi all,

i want to make error handling but a complete ones. i was done with exception (ex) but i need a little bit more like error line,error number or other. does any one know how to do this?

thx.
best regards.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 2,641
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Solved Threads: 245
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: how to make error handling

 
3
  #2
Dec 16th, 2007
you can use err object. this object was built in vb.net.
i will give a simple code for u
try this following code :

  1. sub main()
  2. 10: on error goto errHandling
  3. 20: dim a as integer = 2
  4. 30: dim b as integer = 7
  5. 40: dim c as integer
  6. 50: z = x / y
  7. 60: console.writeline("Value of c : " & c)
  8. 70: exit sub
  9. errHandling:
  10. dim ErrMsg as string
  11. ErrMsg = "Error Number = " & err.number
  12. ErrMsg = chr(13)
  13. ErrMsg = "Error Description = " & err.Description
  14. ErrMsg = chr(13)
  15. ErrMsg = "Erorr Line = " & err.erl
  16. msgbox(ErrMsg)
  17. resume next
  18. end sub

you can use err.clear to clear every err object property
err.source to show object name or application which error provides.

Ok.
all for the best
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 63
Reputation: Sawamura is an unknown quantity at this point 
Solved Threads: 6
Sawamura's Avatar
Sawamura Sawamura is offline Offline
Junior Poster in Training

Re: how to make error handling

 
0
  #3
Dec 17th, 2007
hi jx_man
thx for your fast reply, it run goods and helps.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC