Years ago, a contributor explained a technique to loop through a list until a condition exists – essentially a while loop – using the ITERATE Action in the Xlate.
The technique has come in handy a few times.
Recently, I was asked to explain the technique. I was unable to find the original post, but I think it is worthwhile to repeat. Unfortunately, I do not recall who did the original post so I can make attribution to that Author.
I prepared a document and a sample Xlate showing how to do this While loop using Xlate ITERATE. This example is in relationship to looping over a list. In the document I touch on why (in Cloverleaf 2209) using the USER Type ITERATE is not reliable due to what I suspect is a bug. That situation I posted in an earlier post.
The technique described in the Document will work even on earlier releases of Cloverleaf where the USER Type ITERATE does not exist.
I have attached a PDF file of that document.
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.