Home > Contents > Index >
LOOP
Modifies the list's current row value.
Syntax
<LOOP [FROM="START"] [COUNT="LOOP_TIMES"] [LIST="LIST_NAME"] [UNTIL="END"]> ... </LOOP>Parameters
FROM (optional)
- Row to begin the loop.
COUNT (optional)
- Number of times to loop. If both
COUNT
andFROM
/UNTIL
are specified, the condition that is true first terminates the loop.LIST (optional)
- List to loop through.
UNTIL (optional)
- Compare two values. The operators supported are "=" (values are equivalent) or "!=" (values are not equivalent)".
Description
The
LOOP
tag modifies the list's current row value.If the
UNTIL
condition never evaluates totrue
, theUNTIL
condition is ignored andLOOP
continues to the last item in the list.The column values of the current row in a list can be obtained using the syntax,
List.colname
whereList
is the name of the list andcolname
is the name of the column in the list.
Note
In the case of StringLists, the values can be obtained by using List.Item.
You can use the following attributes to return information about the list using the syntax,
List.attname
, whereattname
can be one of the following attributes:
#numRows
Number of rows in this list#curRow
Current row in this list.#moreRows
Boolean (true/false) to indicate whether there are more rows following the current row.#numCols
Number of columns in this list.@<colname>
Only used on lists that contain resultsets. Contents of the file in the specified column if the colname begins with "url".For example,
MyList.#numRows
returns the number of rows in the listMyList
.MyList.@urlheader
retrieves the contents of the file specified by the column urlheader.The value of a list is maintained during the processing of a page request. If the list contains a resultset, the resultset is maintained independently of a list that uses it.
Error Numbers
There are no possible
errno
for this tag.Example
<SETVAR NAME="errno" VALUE="0" /> <STRINGLIST NAME="NameList" STR="Alex Dan Dorothy Elliot Greg Katie Julie Mark Tom" DELIM="" /> <IF COND="IsList.NameList=true" > <THEN> <BR/>EXAMPLE 1: <LOOP FROM="1" UNTIL="NameList.ITEM=Katie" LIST="NameList"> <CSVAR NAME="NameList.ITEM" /> </LOOP> <BR/>EXAMPLE 2: <LOOP FROM="3" COUNT="4" LIST="NameList"> <CSVAR NAME="NameList.ITEM "/> </LOOP> <BR/>EXAMPLE 3: <LOOP LIST="NameList"> <CSVAR NAME="NameList.ITEM "/> </LOOP> </THEN> <ELSE> Error processing request. Unable to create NameList.<BR/> </ELSE> </IF>The browser displays the following:
EXAMPLE 1: Alex Dan Dorothy Elliot Greg EXAMPLE 2: Dorothy Elliot Greg Katie EXAMPLE 3: Alex Dan Dorothy Elliot Greg Katie Julie Mark TomSee Also
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.