Results 1 to 7 of 7

Thread: [VB6] Compile Error: Block If without End If

  1. #1
    w_is_awesome's Avatar
    Joined
    Dec 2011
    Posts
    132
    Userbars
    1
    Thanks
    61
    Thanked
    12/11
    DL/UL
    78/0
    Mentioned
    12 times
    Time Online
    20h 24m
    Avg. Time Online
    N/A

    [VB6] Compile Error: Block If without End If

    Ok while testing to see if the my neopets login will work I get this "Compile Error: Block If without End If". How do I fix this.


  2. #2

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    You have no End If for any If statement and you should use ElseIf for addidtinnal checks. What wrapper are you using, you may want to use a referrer also?

    Code:
    Private Sub Command1_Click()
    Dim strHTML As String
    
    strHTML = Wrapper.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtuser.Text & "&password=" & txtpass.Text & "&destination=%2petcentral.phtml/")
    
    If InStr(1, strHTML, "badpassword") Then
        Label1.Caption = " Invalid Password/Username "
    ElseIf InStr(1, strHTML, "this account has been ") Then
        Label1.Caption = " this account has been frozen "
    ElseIf InStr(1, strHTML, "petcentral") Then
        Label1.Caption = " Successful Login "
    Else
        Label1.Caption = " unknown error "
        Exit Sub
    End If
    End Sub
    Last edited by Soredavide; 01-15-2012 at 07:02 AM.

  3. #3
    w_is_awesome's Avatar
    Joined
    Dec 2011
    Posts
    132
    Userbars
    1
    Thanks
    61
    Thanked
    12/11
    DL/UL
    78/0
    Mentioned
    12 times
    Time Online
    20h 24m
    Avg. Time Online
    N/A
    I use Gluarks @(you need an account to see links)

    edit: still says it
    Last edited by w_is_awesome; 01-15-2012 at 07:10 AM.

  4. #4

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    Strange it works for me, I get the label to change to Successful Login. Did you use the code I posted or change yours?
    Last edited by Soredavide; 01-15-2012 at 07:30 AM.

  5. #5
    w_is_awesome's Avatar
    Joined
    Dec 2011
    Posts
    132
    Userbars
    1
    Thanks
    61
    Thanked
    12/11
    DL/UL
    78/0
    Mentioned
    12 times
    Time Online
    20h 24m
    Avg. Time Online
    N/A
    no but now i tryed and it came up with a debug error. on the code it shows a arrow pointing toward

    "strHTML = Wrapper.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtuser.Text & "&password=" & txtpass.Text & "&destination=%2petcentral.phtml/")'

    @(you need an account to see links)

  6. #6

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    I am not sure if you had the quotes around the statement or that is how you posted to this site? Make sure everything is named the way it is supposed to be, the wrapper is actually named wrapper (you should get an autocomplete if it is correct, with quite a few options for a drop down)

    You can use the CODE tags to post code.
    Code:
    strHTML = Wrapper.PostWrapper("http://www.neopets.com/login.phtml", "username=" & txtuser.Text & "&password=" & txtpass.Text & "&destination=%2petcentral.phtml/")

  7. #7
    w_is_awesome's Avatar
    Joined
    Dec 2011
    Posts
    132
    Userbars
    1
    Thanks
    61
    Thanked
    12/11
    DL/UL
    78/0
    Mentioned
    12 times
    Time Online
    20h 24m
    Avg. Time Online
    N/A
    quotes where for website...

    ---------- Post added at 08:12 AM ---------- Previous post was at 06:55 AM ----------

    Please close I figured it out from the help of soredivide

Posting Permissions

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