next up previous contents
Next: 2.3.5 Structure Element: StaticText Up: 2.3 The FileStructure Section Previous: 2.3.3 Structure Element: Condition   Contents


2.3.4 Structure Element: Loop

The Loop element indicates that the contained structure and/or operations should be repeated a certain number of times. Loop elements can be nested in order to populate a multi-dimensional array. Loops can be set up in four different ways, which can be combined as needed:

The Loop element has the following attributes:
Attribute Name Description Required
loopVariable Name of a local variable that stores the value of the loop index (iteration) no
start The starting value for the loop index. This can be an integer or the name of a parameter whose value had been set previously yes
end The ending value for the loop index. This can be an integer or the name of a parameter whose value had been set previously yes
incr The increment value for the loop index. This can be an integer or the name of a parameter whose value had been set previously yes
check Value to be checked as part of the stop condition no
operator The relational operator to be used. Must be GT (greater than), LT (less than), or EQ (equal to) no
checkValue The value to check against. This can be the name of a parameter whose value has been set previously no
stopOnEof True/False. If an end-of-file is encountered, a value of ``True'' will throw an exception but the method returns normally; set to ``True'' if an EOF is expected no
doOnce True/False. ``True'' means that, even if the checkValue fails, execute the loop once no

The Loop element must contain one or more structure elements such as Condition or another Loop, or one or more operation elements such as Separator, SetValue, SetSize, SetDims, or AddValue in any order.

$\textstyle \parbox{6.3in}{\textcolor{blue}
{\textbf{Example 1 \hrulefill}}\\
\...
...before reading the values of WSCSTP and WSCFAC
\\ \textcolor{blue}{\hrulefill}}$

$\textstyle \parbox{6.3in}{\textcolor{blue}
{\textbf{Example 2 \hrulefill}}\\
\...
...hese operator conditions is met, the Loop ends
\\ \textcolor{blue}{\hrulefill}}$

Another example, with a portion of an input file, is given in Section 3.3.


next up previous contents
Next: 2.3.5 Structure Element: StaticText Up: 2.3 The FileStructure Section Previous: 2.3.3 Structure Element: Condition   Contents

SAIC Ship Technology Division, Annapolis, Maryland, USA
2004-10-26