Home: Support: Reference Guide: Flow Control: <dpLoop>

<dpLoop>

D E F I N I T I O N:

Looping is most commonly used to step through a story, headline or other display tag by paragraph or font. However you can use it for whatever you want.

<dpLoop var="variable" from="#" to="#" step="#|-#">
   Instructions to repeat.
</dpLoop>


A T T R I B U T E S:

var=(variable name)
Defines the name of a variable. This variable should be considered a counter and will always have the current value you can use.

from="#"
Defines the starting number of the loop.

to="#"
Defines the ending number of the loop.

step="#"
Allows you to step through the loop by a value other than one. The default value is one.


E X A M P L E S:

<dpLoop var="i" from="1" to="10">
   <dpVar i>
</dpLoop>

would create: 1 2 3 4 5 6 7 8 9 10

<dpLoop var="i" from="2" to="10" step=2>
   <dpVar i>
</dpLoop>

would create: 2 4 6 8 10

<dpLoop var="x" from="1" to="<dpImageCount>">
   <dpImage number="<dpVar x>">
</dpLoop>

would list all of the images in the story

<dpLoop var="x" from="1" to="<dpLength unit="p"><dpStory></dpLength>">
   Paragraph #<dpVar x><p>
   <dpStory start="resume" length="<dpVar x>p"><p>
</dpLoop>

would loop through the story one paragraph at a time from the first paragraph to the last paragraph. It would display the paragraph number followed by the paragraph itself.


Home: Support: Reference Guide: Flow Control: <dpLoop>
Questions? Comments?
Please write support@desert.net.