Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does it say loop without do?

Tags:

vbscript

Ok, so i have been given the assignment to make a guessing game. I have it all done and ready, the only problem is when I try to run it says this:

Windows Script Host

Dim MAX, MIN
MAX = 99
MIN = 0
Randomize

Number = (Int((MAX-MIN+1)*Rnd+MIN))

Do Until Answer = Number
Answer = InputBox("Guess A Number Between:" & vbNewLine & "0 And 100", "Guessing Game:")
If Answer = "" Then
    Quit = MsgBox("Do You Wish To Quit?",vbYesNo,"Quit:")
    If Quit = vbYes Then
        WScript.Quit 0
    End If
Else If Answer = Number Then
    MsgBox("Congrats You Got It!")
Else
    MsgBox("Nope, Try Again...")
End If
Loop
like image 648
Jonco98 Avatar asked Dec 14 '25 00:12

Jonco98


1 Answers

Got it; simple oops:

Else If Answer = Number Then

Should be:

ElseIf Answer = Number Then

Separating Else If is creating a new If block, throwing everything off.

like image 156
Andrew Barber Avatar answered Dec 16 '25 19:12

Andrew Barber