|
Get SteelArrow!
|
|
|
|
<SALOOP>
|
|
|
|
|
|
|
|
Return to Tag List |
|
The LOOP tag aids in program flow. The tag is similar to WHILE
in that it allows a script to loop over a block of code a number of times, or until an
expression evaluates to FALSE.
|
|
Attributes:
FROM | start value (index) |
TO | end value (index) |
NAME | index name |
COND | expression to evalutate (not required) |
CONDITION | same as COND |
NOCASE | flag denoting case-insensitive string compare |
|
|
|
The following is an example of LOOP;
|
|
<!--- Create a LIST object containing 12,34,56,78 --->
<SASET NAME=list VALUE=MakeList( ":", "12:34:56:78" )>
<!--- Output list contents --->
<SALOOP COND=list.MoreData()>
<SAOUTPUT VALUE=list><BR>
<SANEXT NAME=list>
</SALOOP>
<!--- Output list contents --->
<SALOOP FROM=0 TO=list.RowCount() NAME=index>
<SAOUTPUT VALUE=list[index]><BR>
</SALOOP>
<!--- Mixed LOOP; only outputs 5 values --->
<SASET NAME=count VALUE=5>
<SALOOP FROM=0 TO=list.RowCount() COND=count.gt.i NAME=i>
<SAOUTPUT VALUE=list[i]><BR>
</SALOOP>
|
|
|
|