• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Flow Control

It's all well and good that you can assign values to variables and perform calculations, but the real power of programming is in the ability to perform operations over and over, and to take different actions when conditions require. That's where flow control comes in. Instead of just executing each and every line of a program in order from top to bottom, conditional statements let you specify how the program is to respond to various situations it may encounter. With looping statements, you can execute certain statements repeatedly. Looping statements record not only how to handle a repetitive task but how to know when to start and stop the task.

Note

In this chapter and in Microsoft's documentation, you'll see VBScript commands capitalized some times but not others. The case doesn't matter; VBScript is not case sensitive. For example, the commands

IF A = 3 THEN 
if A = 3 Then
If a = 3 then

are all the same to VBScript. Microsoft's convention is to capitalize the words of VBScript statements, but I think this looks strange and it's too much of a bother, so I'm not going to capitalize most VBScript words in this chapter.

It is helpful to capitalize certain letters in long names, such as CreateTextFile, just to make them easier to read, so I do tend to capitalize the names of functions, objects, methods, and properties, as you'll see in this chapter. Remember, the case doesn't matter one bit to VBScript. It just makes the scripts easier for humans to read.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint