diff options
Diffstat (limited to 'docs/manual/tasks/for.html')
-rw-r--r-- | docs/manual/tasks/for.html | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/docs/manual/tasks/for.html b/docs/manual/tasks/for.html index ecf23fe..b76789c 100644 --- a/docs/manual/tasks/for.html +++ b/docs/manual/tasks/for.html @@ -41,8 +41,17 @@ <td valign="top">The list of values to process, with the delimiter character, indicated by the "delimiter" attribute, separating each value.</td> - <td align="center" valign="top">Yes, unless a nested path - has been specified.</td> + <td align="center" valign="top" rowspan="2">Yes, one of these needs to + be set, unless a nested path + has been specified.</td> + </tr> + <tr> + <td valign="top">end</td> + <td valign="top"> + Sets the ending index value. If this attribute is + set, the <for> task will loop from "start" (default 1) + to "end", using "step" (default 1) increments. + </td> </tr> <tr> <td valign="top">param</td> @@ -98,6 +107,22 @@ </td> <td align="center" valign="top">No. Defaults to false.</td> </tr> + <tr> + <td valign="top">begin</td> + <td valign="top"> + Sets the starting index value. This in only used + if the "end" attribute is set. + </td> + <td align="center" valign="top">No. Defaults to "1".</td> + </tr> + <tr> + <td valign="top">step</td> + <td valign="top"> + Sets the index increment step. + This in only used if the "end" attribute is set. + </td> + <td align="center" valign="top">No. Defaults to "1".</td> + </tr> </table> <h2>Parameters specified as nested elements</h2> @@ -190,8 +215,29 @@ </ac:sequential> </ac:for> </pre> + + <p> + The following example loops from one to ten. + </p> + <pre> + <ac:for param="i" end="10"> + <sequential> + <echo>i is @{i}</echo> + </sequential> + </ac:for> + </pre> + <p> + The following example counts down from 10 to 0 in steps of -2. + </p> + <pre> + <ac:for param="i" begin="10" step="-2" end="0"> + <sequential> + <echo>i is @{i}</echo> + </sequential> + </ac:for> + </pre> <hr> - <p align="center">Copyright © 2003-2005 Ant-Contrib Project. All + <p align="center">Copyright © 2003-2006 Ant-Contrib Project. All rights Reserved.</p> </body> |