|
||||||
| VB Tutorials Visual Basic Tutorials and Code |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
Introduction:-
Ok So I decided to make a tutorial about error handling! Many programs don't contain error handling but I suggest you that you include it! This will make your program more powerful Solution:- Ok so I am going to show you this code then I will expalin it. I will show you 3 types of error handling What you need:-
Here is the code Code:
Private Sub Command1_Click() On Error GoTo ErrorHandler Error 424 'This error is displayed when there is a missing object Exit Sub ErrorHandler: MsgBox "Error Number: " & Err.Number & " With The Description ->> " & Err.Description & " <<- Occured." End Sub Private Sub Command2_Click() On Error GoTo ErrorHandler Error 424 Exit Sub ErrorHandler: If Err.Number = 424 Then MsgBox "A missing object in your form is needed!, Please refer to the code and arrange accordingly!" Else: MsgBox "Error Number: " & Err.Number & " With The Description ->> " & Err.Description & " <<- Occured." End If End Sub Private Sub Command3_Click() On Error Resume Next Error 424 'This error is displayed when there is a missing object MsgBox "error ignored!" End Sub Code:
On Error GoTo ErrorHandler Code:
Error 424 'This error is displayed when there is a missing object Exit Sub ![]() [code] ErrorHandler: MsgBox "Error Number: " & Err.Number & " With The Description ->> " & Err.Description & " <<- Occured." End Sub [code] This will be the action that will be done when an error occurs it will show you the error number and the description! Code:
ErrorHandler: If Err.Number = 424 Then MsgBox "A missing object in your form is needed!, Please refer to the code and arrange accordingly!" Else: MsgBox "Error Number: " & Err.Number & " With The Description ->> " & Err.Description & " <<- Occured." End If ![]() Code:
On Error Resume Next Error 424 'This error is displayed when there is a missing object MsgBox "error ignored!" ![]() Here we are telling the program to just IGNORE the error and continue the next action ( in this case show a msg box ) Conclusion:- As Always Feedback is welcome and the full source is attached!!
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help Last edited by Jordan; 10-21-2006 at 11:03 AM. Reason: Images moved to local server |
| Sponsored Links |
|
|
|
|||||
|
OMG pls Jordan can you remove this spammers post thanks!
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help |
|
|||||
|
Wow, that is the 4th one I have removed from this tutorial. They really like this one!
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||||
|
Lol! its my tutorial
of course they like it!! lol just kidding! duh damm spammers! they are all over the net!!
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help |
|
|||||
|
Suggested that we enable Image Verification on registration. I made a thread about it for the Mods/Admins to comment.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Company Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() |
| Sponsored Links |
|
|
|
|||||
|
Quote:
http://forum.codecall.net/hosting-do....html#post8774 This would definitely make it harder!!
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help Last edited by TcM; 11-26-2006 at 12:26 PM. |
|
|||||
|
Well perhaps because it has 4 votes? as rating? I really dont know!!
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help |
|
|||||
|
This is a VB tutorial not a JS one.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall ![]() Business Directory | Technology Blog | Windows Help |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VB6.0:Tutorial, WipeFile | TcM | VB Tutorials | 8 | 06-11-2008 11:33 AM |
| VB6.0:Tutorial, Command Line | TcM | VB Tutorials | 6 | 01-12-2007 07:34 AM |