[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

<break> when using included <while> tags



Is there a way to make the <break> tag act on the _current_ while loop,
instead of the innermost one? Or maybe another way to get the same 
result...

To make myself clear, here is the current behaviour of this tag:

Exemple from the doc:
Source
  <set-var i=10>
  <while <gt <get-var i> 0>>;;;
    <get-var i> <decrement i>;;;
    <ifeq <get-var i> 5 <break>>;;;
  </while>
Output
10 9 8 7 6

But if I add another while loop, than the <break> affects the next
instance of that inner loop, which is not what I want:
Source
  <set-var i=10>
  <while <gt <get-var i> 0>>;;;
    <get-var i> <decrement i>;;;
  <ifeq <get-var i> 5 <break>>;;;
    <set-var j=1>
    <while <lt <get-var j> 3>>;;;
      <get-var j> <increment j>;;;
    </while>
  </while>
Output
10
  1 2
9
  1 2
8
  1 2
7
  1 2
6
5
  1 2
4
  1 2
3
  1 2
2
  1 2
1
  1 2


Sincerely,

--
Ghislaine Labouret, Network security consultant
Hervé Schauer Consultants (HSC) - http://www.hsc.fr/
Phone (+33)-141-409-700 - Fax (+33)-141-409-709
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com