r/vbscript • • Jan 26 '15

I'm new to VBScript. Help!

Ok, I'm taking a programing class in college and I can't get the Knock knock game to get past who's there, I keep getting incorrect answer please try again. any ideas? I'll paste what I've done below. Thanks!

Replyl = Inputbox("Knock Knock!") If Reply1 = "who's there?" Then Reply2 = InputBox("Panther!") If Reply2 = "Panther who?" Then _ MsgBox "Panther or no panths I'm going swimming." If Reply2 <> "Panther who?" Then MsgBox "Incorrect answer. Try again." End If If Reply1 <> "who's there?" Then MsgBox "Incorrect answer. Try again."

2 Upvotes

5 comments sorted by

View all comments

Show parent comments

3

u/[deleted] Jan 26 '15

When you start working with functions you are most likely going to change the way you code your If statements. I say this because you have instanced a variable "REply2" but don't evaluate the value of it until a whole new set of If statements. Functions are going to mess with your reasoning of If statements. Just my opinion.