Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What are error handlings in Visual basic?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 02-01-2011
Member
 
Join Date: Mar 2010
Posts: 515
What are error handlings in Visual basic?
  

Hey Guys, Can someone tell me what error handling in Visual basic 6.0 are? I don?t have a large amount acquaintance regarding Visual basic 6.0 but still I am not able get the perception of error handlings in visual basic. I am not able to find any link in it. But, I am not sure about it. I don?t have any clue regarding this topic. So, if anyone who has any knowledge or information about this than let know.

Reply With Quote
  #2  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 620
Re: What are error handlings in Visual basic?

The On Error statement is used to trap the run-time errors and not the syntax errors. It has the following three forms: 1. On Error GoTo LineLabel LineLabel is a label given to a specific line. It must be in the same procedure as the On Error statement. When a run-time error occurs, the program jumps to that label. The code following the label must handle the error. On Error Resume NextIf a run-time error occurs, the line which generated the error is skipped and execution is continued with the next line. On Error GoTo 0It is used to turn off error handling. Any error occurring after this statement will cause a run-time error.
Reply With Quote
  #3  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 523
Re: What are error handlings in Visual basic?

The Err object holds information about an error that has occurred. It is a predefined object and hence requires no declaration. It must be noted that the properties of the Err object are cleared whenever execution is transferred to another procedure or a Resume statement is executed. Err object has the following important properties and methods are Source Property in which it contains the name of the object or application that caused the error. Number Property It contains the error number which may range from 0 to 65535.
Reply With Quote
  #4  
Old 02-01-2011
Member
 
Join Date: Apr 2009
Posts: 484
Re: What are error handlings in Visual basic?

You can also use a Description Property in which it contains the description of the error. Then, we have is Raise Method where it is used to generate run-time errors. If an error occurs that you had not anticipated and coded for, this method is used to generate that error so that a dialog box is displayed describing the error. Syntax Err.Raise ErrorNumber [, Source] [, Description] [, HelpFile] [, HelpContext] ErrorNumber is the only compulsory argument.
Reply With Quote
  #5  
Old 02-01-2011
Member
 
Join Date: May 2009
Posts: 525
Re: What are error handlings in Visual basic?

After solving the error, the program should continue execution if possible. The Resume statement is used for this purpose. The Resume statement has the following three forms such as Resume it is used to continue execution with the line that caused the error. If the error-handling routine calls a different procedure that contains a Resume statement, execution continues with the line that called the second procedure. Resume Next It is used to continue execution with the line following the line that caused the error.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What are error handlings in Visual basic?"
Thread Thread Starter Forum Replies Last Post
Runtime Error 91 in Visual Basic 6 Trance Maniac Software Development 6 24-12-2010 11:36 PM
Visual Basic Runtime Error 2147467259(8000405) Sophia Software Development 3 04-04-2010 11:04 AM
Run-Time Error 713 in Visual Basic austin26 Software Development 4 26-11-2009 04:58 PM
Visual Basic Error 400 Abejar Software Development 2 12-05-2009 01:38 PM
Visual Basic Error? in Microsoft Office 2003 CostasD MS Office Support 5 04-12-2008 02:12 AM


All times are GMT +5.5. The time now is 01:54 PM.