XFA Specification
Chapter 23, FormCalc Specification
Grammar and Syntax
822
Continue Expression
93 ContinueExpression = 'continue'
A continue expression causes the next iteration of the innermost enclosing
while
,
for
, or
foreach
loop.
When used in a
while
expression, control is passed to the
while
condition. When used in a
for
expression, control is passed to the step expression.
The value of the continue expression is always the value zero (0). See
Example 23.1.
If Expressions
94 IfExpression ::= 'if' '(' SimpleExpression ')' 'then'
ExpressionList ( 'elseif' '(' SimpleExpression ')' 'then'
ExpressionList )
*
( 'else' ExpressionList )
?
'endif'
An
If Expressions
is a conditional expression, which, depending upon the value of the SimpleExpression
67
in the if-part, will either evaluate and return the value of the ExpressionList
65
in its then-part or, if present,
evaluate and return the value of the ExpressionList in its elseif-part or else-part.
See “Code blocks
determine span of declarations” on page 825.
Syntax
foreach
variable
in(
argument list
)do
expression list
endfor
Return
The value of the SimpleExpression
67
in the if-part is promoted to a boolean value and a logical boolean
operation is performed. If this boolean operation evaluates to true (1), the value of the ExpressionList
65
in
the then-part is returned. Otherwise, if there's an elseif-part present, and the value of the
SimpleExpression in the elseif-part evaluates to true (1), then the value of its ExpressionList is returned.If
there are several elseif-parts, the SimpleExpression of each elseif-part, is evaluated, in order, and if true(1),
then the value of its corresponding ExpressionList is returned. Otherwise, the value of the ExpressionList in
the else-part is returned; if there is no else-part, the value 0 is returned. In any circumstance, only one of
the expression lists is ever evaluated.
For Expressions
95 'for' Assignment 'upto' Accessor ('step' SimpleExpression)
?
'do' ExpressionList 'endfor' |
'for' Assignment 'downto' Accessor ('step' SimpleExpression)
?
'do' ExpressionList 'endfor'
A For Expression is a conditionally iterative statement or loop.
The for condition declares and defines a FormCalc variable as the value of the start expression. In the upto
variant, the value of the loop variable will iterate from the start expression to the end expression in step
expression increments. If you omit the step expression, the step increment defaults to 1. In the downto
variant, the value of the loop variable iterates from the start expression to the end expression in step
expression decrements. If the step expression is omitted, the step decrements defaults to -1.
Iterations of the loop are controlled by the end expression value. Before each iteration, the end expression
is evaluated and compared to the loop variable. If the value is true (1), the expression list is evaluated. After
each evaluation, the step expression is evaluated and added to the loop variable. Before each iteration, the
end expression is evaluated and compared to the loop variable. In addition, after each evaluation of the do
condition, the step expression is evaluated and subtracted from the loop variable.
Home Index Bookmark Pages
Pages: Home Index All Pages