breaking out of loop

Results 1 to 2 of 2

Thread: breaking out of loop

  1. #1
    Join Date
    Dec 1969

    Default breaking out of loop

    I want to break out of the current loop if the value of news="" but i don&#039;t want to break out of the loop entirely...just that value of num <BR><BR>****here is where i&#039;m confused<BR><BR>&#060;%<BR>Function url()<BR>Dim NEWS, checked, target, num<BR>For num = 1 to 6<BR> NEWS = objRSnewsBox("News" & num)<BR> If NEWS = "" Then<BR> **** <BR> Else<BR> target = objRSnewsBox("Target" & num)<BR> If Not target= "" Then<BR> Response.Write "&#060;a class=&#039;newslink&#039; href=" +target + "&#062;" + NEWS + "&#060;/a&#062;"<BR> else<BR> Response.Write NEWS<BR> End If<BR> End If<BR> Response.Write "<BR>"<BR>Next<BR>End Function<BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: breaking out of loop

    I assume you are trying to not work with any of the news values that are empty while iterating through. Can you just do it so that you test for:<BR>FOR num = 1 to 6<BR>IF NOT NEWS = "" THEN<BR>...code...<BR>END IF<BR>NEXT<BR>Then it will keep iterating and ignore the missing data<BR><BR>HTH bizz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts