An if statement is used to make decisions.
It is used in conjunction with Boolean values which represent the result of a decision as true or false.
The "if ... then ..." structure works just how it sounds.
If a given condition is true, then the given statements are executed.
Otherwise the statements are skipped.Consider the following example.
dim x as Number
if x < 0 then
print "Negative number"
else if x > 0 then
print "Positive number"
After the user types a number and presses Enter, only one of the three print statements will execute.
It may help to view the path of execution using a flow chart.