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:






store is open


buy chicken

The real power of If...Then comes into play when combined with tools such as those we looked at in Chapter 2. If...Then is rarely used by itself. Although you could have a script such as this one, you wouldn’t find it extremely valuable:

Const a = 2
Const b = 3
Const c = 5
If a + b = c Then
End If

In this script are defined three constants: a, b, and c. We then sum the numbers and evaluate the result by using the ...

Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.