Results 1 to 2 of 2

Thread: abort statement

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    3

    abort statement

    Is there a way to program a button on a form so that when it is clicked it aborts the whole program.
    Here's the code I have for an OK button (validates what the user types in)

    Dim sr As IO.StreamReader = IO.File.OpenText("password.txt")
    Dim usernamebox, readusername As String
    Dim passwordbox, readpassword As String
    Dim lines As Integer
    Dim form As New Login()

    usernamebox = txtusername.Text.ToUpper
    passwordbox = txtpassword.Text.ToUpper

    Do While sr.Peek <> -1
    readusername = sr.ReadLine.ToUpper
    readpassword = sr.ReadLine.ToUpper

    If readusername = usernamebox Then
    MsgBox(readusername)
    If readpassword = passwordbox Then
    MsgBox(readpassword)
    Exit Do
    End If
    End If
    Loop

    if (usernamebox = " ") or (passwordbox = " ")

    abort statement here

    End If

    sr.Close()

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I think you can still use End

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width