tailieunhanh - Microsoft WSH and VBScript Programming for the Absolute Beginner Part 14

Microsoft WSH and VBScript Programming for the Absolute Beginner by Jerry Lee Ford Part 14. 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,. | Microsoft WSH and VBScript Programming for the Absolute Beginner Second Edition StoryMsg Once upon a time there were 3 little pigs vbCrLf _ who liked to build things. vbCrLf vbCrLf _ vbTab The End Display the story to the user MsgBox StoryMsg vbOkOnly vbExclamation cTitleBarMsg The text message that is displayed by the script is Once upon a time there were 3 little pigs who liked to build things. The End Notice how the vbCrLf and vbTab constants have been placed throughout the text to specify how VBScript should display message text. Figure shows the output that is displayed when this script is executed. Vigure Using VBScript string constants to manipulate the display of text in pop-up dialogs. If the vbCrLf and vbTab constants were removed from the formatted message the text displayed in the pop-up dialog would look completely different as shown in Figure . Figure Displaying the same output as the previous example without the use of the vbCrLf and vbTab constants. For more information about VBScript constants go to http and click on the VBScript Documentation link. Chapter 4 Constants Variables and Arrays Storing Data That Changes During Script Execution Chances are most programs that you write will have data in them that will need to be modified. For example you may write a script that asks the user for input and then modifies the data while processing it. In this situation you can define variables. Two categories of variables are available to your scripts variables that you define within your scripts and environment variables that are maintained by Windows that your scripts can reference. I ll demonstrate how to work with both categories of variables in the sections that follow. VBScript Data Types Unlike many other programming languages VBScript only supports one type of variable called a variant. However a variant is very flexible and can be used to store a number of different types of data. Table lists variant data