If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Syntax help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-25-09, 08:38
hoy145 hoy145 is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Syntax help

hey, i am new to VB6, i started using it approximatley 2 weeks ago, and i have only just encounered my first error, i need help, when i compile and run, i get the error message "block IF without END IF", could someone please correct me, i have attatched my code in a .txt
Attached Files
File Type: txt Code.txt (561 Bytes, 52 views)
Reply With Quote
  #2 (permalink)  
Old 06-25-09, 09:35
Sequin Sequin is offline
Registered User
 
Join Date: Feb 2007
Posts: 4
Code:
Private Sub cmdroll_Click()
    Label1.Caption = Int(Rnd * 10)
    Label2.Caption = Int(Rnd * 10)
    Label3.Caption = Int(Rnd * 10)

    If Label1.Caption = 7 And Label2.Caption = 7 And Label3.Caption = 7 Then

        win.Caption = win.Caption + 2
        MsgBox "SUPER WIN!!", vbExclamation, "SUPERB!"


    Else

        If Label1.Caption = 7 Or Label2.Caption = 7 Or Label3.Caption = 7 Then

            win.Caption = win.Caption + 1
            MsgBox "You Win!!", vbExclamation, "WINNER"

        Else

            Beep
            lose.Caption = lose.Caption + 1

        End If
    End If

End Sub
Reply With Quote
  #3 (permalink)  
Old 06-25-09, 09:44
hoy145 hoy145 is offline
Registered User
 
Join Date: Jun 2009
Posts: 4
Thanks

Ahhh thank you so much

bet its all so simple to you

thanks again,
Hoy145
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On