Đang chuẩn bị liên kết để tải về tài liệu:
Microsoft WSH and VBScript Programming for the Absolute Beginner Part 33

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Microsoft WSH and VBScript Programming for the Absolute Beginner by Jerry Lee Ford Part 33. If you are new to programming with Microsoft WSH and VBScript and are looking for a solid introduction, this is the book for you. Developed by computer science professors, books in the for the absolute beginner series teach the principles of programming through simple game creation. You will acquire the skills that you need for more practical WSH and VBScript programming applications and will learn how these skills can be put to use in real-world scenarios. Best of all, by the time you finish this book,. | 300 Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition The Player wants to quit the game If strProcessGuess ExitFunction Then Exit Function End If The player typed invalid input If strProcessGuess SkipRest Then strProcessGuess SecondLevelValidation Select Case strProcessGuess Case DuplicateWrongAnswer MsgBox Invalid You ve already guessed this incorrect letter. Case DuplicateRightAnswer MsgBox Invalid You ve already guessed this correct letter. Case Else strCheckAnswer TestLetterGuess If strCheckAnswer IncorrectAnswer Then Reset the value of variable used to build a string containing the interim stage of the word as currently guessed by player strTempStringTwo NonGuessedString Check to see if the player has guessed the word blnGameStatus CheckIfGameWon If blnGameStatus True Then blnWordGuessed True Exit Do End If Set the value of the temporary string equal to the string created by the Previous For.Next loop strTempStringOne strTempStringTwo Clear out the value of the strDisplayString variable Chapter 9 Handling Script Errors strDisplayString FlipString End If End Select End If Loop DisplayGameResults End Function Building the RetrieveWord Function This function is designed to retrieve a randomly selected word to be used by the game. RetrieveWord first selects a random number between 1 and 10 and then uses that number to retrieve a game word from the WordList array. This function randomly retrieves a word from an array. Function RetrieveWord Randomize intRandomNo FormatNumber Int 10 Rnd RetrieveWord astrWordList intRandomNo End Function This is a good place to perform another test. This time open the temporary script that you created a little earlier and cut and paste it into the statements located in the previous function. Paste the three statements into the temporary file making them lines 3 though 5 in the script. Next add the following statement as line 6 MsgBox RetrieveWord Save and run the script. Each time you execute the .