Results 1 to 3 of 3

Thread: Syntax help

  1. #1
    Join Date
    Jun 2009
    Posts
    4

    Unanswered: 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 Attached Files

  2. #2
    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

  3. #3
    Join Date
    Jun 2009
    Posts
    4

    Thanks

    Ahhh thank you so much

    bet its all so simple to you

    thanks again,
    Hoy145

Posting Permissions

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