Handling With Errors On VB by Salman Paji

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #11330
    imFiles
    Member

    This was explain by salmanpaji in the old forums 🙂

    Remember Always Put The Error codes In Your Sub’s

    e.g: this One will show the Error….and then close the application

    Sub Command1_Click()
    
    On Error GoTo Err:
    
    kill "C:1.txt"
    
    
    Err:
    
    MsgBox Err.Description
    
    'Error: File Not Found.
    
    End
    
    End Sub

     

    e.g: this One will show the Error….and Will continue Afterwards

    Sub Command1_Click()
    
    On Error Resume Next
    
    kill "C:1.txt"
    
    'Error: File Not Found.
    
    'Continue
    
    End Sub

     

    This Is Learmning Steps For The Beginners : Visual Basic Programmers
    by Salman Paji (Of PTDevils)

    http://www.ptdevils.com/

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.