Controlling the flow of a script is of uptmost importance. This can easily
be considered the most important aspect of any programming language.
The ability to make decisions about what code should be executed based on
a condition makes it possible to create one script that can perform several
useful operations, making code more modular, and easier maintained.
The SteelArrow examples that are used for XML output are great examples of how program
flow can be controlled within one script. The scripts
.xmlByCol
and
.xmlByRow
first check to see if the parameter output has been defined. If it has not,
the page is displayed in HTML, offering a link that does define the output
variable.
With the SteelArrow <SAIF> tag, similar processing can be accomplished for
any operation. The <SAIF> tag takes an attribute that describes the expression
that is to be evaluated. This expression will evaluate to TRUE or FALSE, and will be
the sole reason that a block of code is executed.
The general format of the <SAIF> tag is as follows:
|