Artifact 5968b08dc08fd2c006b62faaa029d96b3304450b54473ae6e4059a975b1fef50:
- Executable file
r37/lisp/csl/html/r37_0056.html
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1418) [annotate] [blame] [check-ins using] [more...]
<A NAME=REPEAT> <TITLE>REPEAT</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>REPEAT</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>command</B><P> <P> <P> <P> The <A HREF=r37_0056.html>repeat</A> command causes repeated execution of a statemen t <em>until</em><P> <P> the given condition is found to be true. The statement is always executed at least once. <P> <H3> syntax: </H3> <P> <P> <em>repeat</em><statement> <em>until</em> <condition> <P> <P> <P> <statement> can be a single statement, <A HREF=r37_0038.html>group</A> statement, or a <em>begin</em>...<em>end</em> <A HREF=r37_0041.html>block</A>. <condition> must be a logical operator that evaluates to true or nil. <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> <<m := 4; repeat <<write 100*x*m;m := m-1>> until m = 0> >; 400*X 300*X 200*X 100*X <<m := -1; repeat <<write m; m := m-1>> until m <= 0> >; -1 </TT></PRE><P><em>repeat</em>must always be followed by an <em>until</em> with a condition. Be careful not to generate an infinite loop with a condition that is never true. In the second example, if the condition had been <em>m = 0</em>, it would never have been true since <em>m</em> already had value -2 when the condition was first evaluated. <P> <P> <P>