Skip elements in a foreach loop?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • AdamM

    Skip elements in a foreach loop?

    How can I skip an element in a foreach loop? Break seems to jump completely
    out of the foreach. I just want to move along to the next element based on
    some condition.

    Thanks in advance!

    Adam


  • Michael C

    #2
    Re: Skip elements in a foreach loop?

    "AdamM" <adam@nospam.co m> wrote in message
    news:uKsY3pvRGH A.5728@tk2msftn gp13.phx.gbl...[color=blue]
    > How can I skip an element in a foreach loop? Break seems to jump
    > completely out of the foreach. I just want to move along to the next
    > element based on some condition.[/color]

    continue
    [color=blue]
    >
    > Thanks in advance!
    >
    > Adam
    >[/color]


    Comment

    • mailme.manasi@gmail.com

      #3
      Re: Skip elements in a foreach loop?

      Use Continue instead of break.

      Regards,
      Manasi

      Comment

      • mailme.manasi@gmail.com

        #4
        Re: Skip elements in a foreach loop?

        Use Continue instead of break.

        Regards,
        Manasi

        Comment

        Working...