How di I exit a <mvt:foreach loop?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • dreamingdigital
    replied
    HTML Code:
    <mvt:foreachstop />

    Leave a comment:


  • wajake41
    replied
    Re: How di I exit a &lt;mvt:foreach loop?

    Thanks Bill, this helps!
    However, is there a way to set the value of pos1 to a value? And if this value is greater than the number of entries in the array, can this force an exit from the foreach loop?

    Thanks, Larry
    www.rvparksupplies.com

    Leave a comment:


  • wcw
    replied
    Re: How di I exit a &lt;mvt:foreach loop?

    The foreach loop goes quite fast, even if you have hundreds of entries. The easy thing to do is only display those that you want. For example if you only want to display the first 5, then you would have
    <mvt:foreach.....
    <mvt:if expr="pos1 LT 6">
    stuff to display
    </mvt:if>
    </mvt:foreach>

    It has been asked before to have a foreach stop but Miva has not yet added one.

    Leave a comment:


  • wajake41
    replied
    Re: How di I exit a &lt;mvt:foreach loop?

    Follow up question. Is there a way to exit the foreach loop after finding the entry I want that will allow the processing to continue in this header?
    Can I set the foreach index to do this?

    Larry
    www.rvparksupplies.com

    Leave a comment:


  • wajake41
    replied
    Re: How di I exit a &lt;mvt:foreach loop?

    Thanks for the clarification.
    Larry
    www.rvparksupplies.com

    Leave a comment:


  • wcw
    replied
    Re: How di I exit a &lt;mvt:foreach loop?

    It exits the page header.

    Leave a comment:


  • wajake41
    started a topic How di I exit a <mvt:foreach loop?

    How di I exit a <mvt:foreach loop?

    Hello forum: I'm processing a foreach loop, After I find the entry I want, I want to exit the loop without processing any more entries in the array. I'm trying to use the <mvt:exit> from within an <mvt:if conditional inside the foreach loop. This processing is being done in my page header area. Will the <mvt:exit> take me to the next Mima statement following my </mvt:foreach> or does it exit the entire page header?

    Thanks, Larry
    www.rvparksupplies.com
Working...