Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Help with if/elseif?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,819
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with if/elseif?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Help with if/elseif? - 4/1/2003 11:54:51 AM   
  eternalprophet

 

Posts: 1
Score: 0
Joined: 4/1/2003
From:
Status: offline
Sub guess_onClick
currguess = document.randNum.myguess.value
if (currguess = randnumb) then
alert("You guessed the correct number!")
elseif (currguess < randnumb) then
alert("Too Low!")
numGuess = numGuess + 1
document.randNum.numGuess.value = numGuess
else
alert ("Too High!")
numGuess = numGuess + 1
document.randNum.numGuess.value = numGuess
end if

Forgive me, I could not make the entire html code appear, sniff. But, is there anything anyone can see wrong with the if statement above. If there is, please let me know.
 


Random Number Guessing Game


































High Number
Low Number
Enter Your Guess:
Total Number of Guesses:
Click to Give Up!



 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Help with if/elseif? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts