Difference between revisions of "Command/doloop"

From Wiki
Jump to navigation Jump to search
m (Create entire page)
 
m (looplevel --> recurselevel)
Line 7: Line 7:
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
<table cellspacing="4" cellpadding="2" class="cmd">
 
   <tr>
 
   <tr>
     <td colspan="2" class="cmd">\doloop</td><!--
+
     <td colspan="2" class="cmd">\doloop<!--
 
   --><span class="second" >{''commands''}</span><!--
 
   --><span class="second" >{''commands''}</span><!--
   --></tr>
+
   --></td></tr>
 
   <tr valign="top" class="second">
 
   <tr valign="top" class="second">
 
     <td class="cmd">{''commands''}</td>
 
     <td class="cmd">{''commands''}</td>
Line 18: Line 18:
 
== Description ==  
 
== Description ==  
  
Repeat until {{cmd|exitloop}} is encountered.
+
Repeat indefinitely; stop after a loop in which {{cmd|exitloop}} is encountered, or immediately when {{cmd|exitloopnow}} is encountered.
  
 
== Example ==
 
== Example ==

Revision as of 10:10, 14 June 2012

\doloop

Syntax

\doloop{commands}
{commands} Commands or text to repeat

Description

Repeat indefinitely; stop after a loop in which \exitloop is encountered, or immediately when \exitloopnow is encountered.

Example

\setuppapersize[A10, landscape][A8, landscape]
\setuppaper[nx=2, ny=2]
\setuppagenumbering[location=footer]
\setuparranging[XY]
\showframe[edge]

\starttext
\dorecurse{4}{
    hello\crlf
    \doloop{
        \ifnum \pagenumber=\recurselevel  
            \exitloop 
        \fi
        bla
    }
    \page[yes]
}
\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: