Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

[RESOLVED] Self Teaching VBScript- Noob question

$
0
0
I am working with the book Microsoft WSH and VBScript Programming for the Absolute Beginner. Third Edition The first chapter introduces a sample script that is supposed to build a knock knock game, except in doesn't work. I have copied the code from the ebook to make sure I didn't make any typos. Because the point of me following this book is to learn these concepts, I would like to figure out why it isn't working.
The code in the book is:
Reply1 = InputBox(“Knock Knock!”)
If Reply1 = “Who’s there?” Then
Reply2 = InputBox(“Panther!”)
If Reply2 = “Panther who?” Then _
MsgBox “Panther 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.”

I moved the last if statement to line 4 and was able to get the program to at least display the text boxes when the correct answers were filled in, however if I make reply1 or Reply2 anthing other than what the program wants it just closes instead of displaying the "Incorrect answer" box.

I know this isn't important, but I would love to know what is wrong since I bought a book to teach me this and it's own code isn't working as it intends.

Thank you in advance

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>