Menu

Loop Status

A Loop status value can provide information of a loop in progress. Its primary use is in condition expressions within a loop.

Methods

getCount() Resolves into a Number telling the number of the current iteration within this loop. During the first iteration the value is 1.

For example, the expression ${loopStatus.getCount() == 1} resolves into true only on the loop's first round.

Using the shorthand form the expression becomes ${loopStatus.count == 1}.
getIndex() Resolves into a Number telling the index of the current iteration within this loop. During the first iteration the value is 0.

For example, the expression ${loopStatus.getIndex() == 0} resolves into true only on the loop's first round.

Using the shorthand form the expression becomes ${loopStatus.index == 0}.
isFirst() Resolves into a Boolean telling whether the current iteration is the first iteration (true) of the loop or not (false).

For example, the expression ${!loopStatus.isFirst()} resolves into true on all iterations except the first.

Using the shorthand form the expression becomes ${!loopStatus.first}.
isLast() Resolves into a Boolean telling whether the current iteration is the last iteration (true) of the loop or not (false).

For example, the expression ${loopStatus.isLast()} resolves into true on the loop's last round.

Using the shorthand form the expression becomes ${loopStatus.last}.

Comments

0 comments