Skip to content

Handling With Errors On VB by Salman Paji

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #190160
    Admin
    Administrator

    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)

    #190161
    Admin
    Administrator

    This Code Example Shows The Deleting Of A File “1.txt”
    From the “C:” Directory…. Hope This Helps The Beginners,
    Who Are Learning VB…. Good Luck Guyz

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.