18 – advanced command files, How to use the if command – Gasboy CFN III Mgnr's Mnl V3.4 User Manual
Page 207

MDE-4315 CFN Series CFN III Manager’s Manual for Windows NT · August 2004
Page 191
Advanced Command Files
18 – Advanced Command Files
If you have had some computer programming experience, this chapter should
be self-explanatory. If you have not had any computer programming
experience, you might want to discuss this chapter with the person in your
organization who has the most knowledge about computers.
How to Use the IF Command
The IF command allows conditional execution of the next one or more
commands in a command file. IF uses several switches that allow you to
specify conditions.
IF supports block-structured statements, and uses Pascal-type blocking. The
format of an IF statement is:
IF condition [text]
BEGIN
command1
command2
command3
. . . .
END
ELSE
BEGIN
command1
command2
command3
. . . .
END
If condition is true, the commands following IF will be executed. If condition is
not true, the commands following the optional ELSE will be executed. The
ELSE part is optional and may be omitted if not needed.
BEGIN and END, on lines by themselves, delimit the commands. They are not
required if only one command line follows IF or ELSE.
IF statements can be nested.
Note: The indents are not required. Blank lines and tabs and spaces at the
beginning of lines are ignored (but are a good way to keep track of
subsections in your code).