URGENTE- [VB] Como limpar Arrays

Agora surgiu outro problema...Else without if

Código:
Private Sub Picture1_Click(Index As Integer)
If lblrestantes.Caption = 0 Then
    MsgBox ("Ganhou")
    MsgBox ("Deseja tentar outra vez ?,vbYesNo, Confirmação")
Else
If lbltentativas = 0 Then
If MsgBox("Perdeu, deseja tentar outra vez?", vbYesNo, "Confirmação") = vbYes Then
For i = Picture1.LBound To Picture1.UBound
        Picture1(i).Picture = LoadPicture("mina.jpg")
        Next i
        End If
Else
     End
End If
[B][U][SIZE=3]Else[/SIZE][/U][/B]
lbltentativas = lbltentativas - 1
End If
For i = 0 To 6
    If Index = Chave(i) Then
        Picture1(Index).Picture = LoadPicture("mina.jpg")
    lblrestantes.Caption = Val(lblrestantes.Caption) - 1
  End If
Next
If Picture1(i).Picture = LoadPicture("mina.jpg") Then
 ' lblrestantes.Caption = Val(lblrestantes.Caption) - 1
End If
End If
End Sub


Como posso resolver isto?? Obrigado a quem está a tentar ajudar ;)

Edit- Desculpem não ter usado a tag code anteriormente.
 
Última edição:
Agora surgiu outro problema...Else without if

Ok, afinal sempre havia erros de estrutura.

Código:
Private Sub Picture1_Click(Index As Integer)
  If lblrestantes.Caption = 0 Then
    MsgBox ("Ganhou")
    MsgBox ("Deseja tentar outra vez ?,vbYesNo, Confirmação")
  Else
    If lbltentativas = 0 Then
      If MsgBox("Perdeu, deseja tentar outra vez?", vbYesNo, "Confirmação") = vbYes Then
        For i = Picture1.LBound To Picture1.UBound
          Picture1(i).Picture = LoadPicture("mina.jpg")
        Next i
      End If
    Else
      End
    End If
    lbltentativas = lbltentativas - 1
  End If
  For i = 0 To 6
    If Index = Chave(i) Then
        Picture1(Index).Picture = LoadPicture("mina.jpg")
        lblrestantes.Caption = Val(lblrestantes.Caption) - 1
    End If
  Next
  If Picture1(i).Picture = LoadPicture("mina.jpg") Then
   ' lblrestantes.Caption = Val(lblrestantes.Caption) - 1
  End If
End Sub

A sério ... faz indenting de blocos. Facilita bastante a compreensão e o debug.
 
Back
Topo