Loops/Nested: Difference between revisions

Content added Content deleted
(add RPL)
Line 3,510: Line 3,510:
</pre>
</pre>


=={{header|RPL}}==
As there is no <code>BREAK</code> instruction in RPL, premature loop exit is usually made by forcing the loop variable to its end value. Depending on the way exit is required and on the need for code optimization within the loop, there are several ways to implement such a break feature. The following one is based on two <code>FOR..NEXT</code> loops:
As there is no <code>BREAK</code> instruction in RPL, premature loop exit is usually made by forcing the loop variable to its end value. Depending on the way exit is required and on the need for code optimization within the loop, there are several ways to implement such a break feature. The following one is based on two <code>FOR..NEXT</code> loops: