O'Reilly logo

Microsoft® VBScript Step by Step by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Adding Intelligence

Before You Begin

To successfully complete this chapter, you need to be familiar with the following concepts, which were presented in Chapter 1 and Chapter 2:

  • Declaring variables

  • Basic error handling

  • Connecting to the file system object

  • Using For Each...Next

  • Using Do While

After completing this chapter, you will be able to:

  • Use If...Then

  • Use If...Then...ElseIf

  • Use If...Then...Else

  • Use Select Case

  • Use intrinsic constants

If...Then

If...Then is one of those programming staples (like fried chicken and mashed potatoes are staples in the southern United States). What’s nice about If...Then is that it makes sense. We use this kind of logic all the time.

The basic operation is diagrammed here:

If

condition

Then

action

If

store is open

Then

buy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required