For...Next jump syntax?(RESOLVED)
Hello all..
working on parsing a large string...and I can't remember the code to test for a certain word in the string, and if it's there, to jump to the next item..
here's the code so far..
Code:
For r = 1 To 85
'code snip...
' now test to see if the word transparent is in the next 50 chars...
' set var to the group of 50 chars
GROUP = Mid(Text6.Text, lnEndPos, 50)
' DEBUG: show group just grabbed
Text13.Text = GROUP
' trap here...
FOUNDIT = InStr(Text13.Text, "transparent")
If FOUNDIT > 0 Then
Text14.Text = FOUNDIT
' found transparent so jump to next iteration
Next r
End If
'code snip here where I parse the string and then save it in a list
next r
When I run this, my error is "Compile error : next without for"
???
Jim
Cripes....maybe I'm not being clear?
Here's the complete routine to parse the HTML from a web page...
I have included it so you can all see, that I want to be able to TEST for a word (transparent) within a small string, if it is NOT present, then add an item to a list ELSE skip this item and go to the next....
Code:
'Parse HTML page here...
For r = 1 To 85
If lnStartPos > 2 Then
lnStartPos = lnStartPos
Else
lnStartPos = 1
End If
' above checks to see if we've run this once before and if so then leave the
' value of lnStartPos alone, else set it at 1 for the first run thru...
lnStartPos = InStr(lnStartPos, Text6.Text, START)
' start at the end of the delimter...
' Text7.Text = lnStartPos
' DEBUG: just shows the starting position for the grab...
lnStartPos = (lnStartPos + 16)
'add the 10 chars for START and the 4 chars of html
lnEndPos = InStr(lnStartPos, Text6.Text, "</TD>")
' and now run to the end of the proxy...
'TEST here for TRANSPARENT term
'======================================
' set var to the group of 50 chars
GROUP = Mid(Text6.Text, lnEndPos, 50)
' DEBUG: show group just grabbed
Text13.Text = GROUP
' trap here...
FOUNDIT = InStr(Text13.Text, "transparent")
If FOUNDIT > 0 Then
Text14.Text = FOUNDIT
Next r
' **** this does not work!!!!***
' I wish to skip this spot, and go to the next r....
' how do I do that?
End If
lnNumber = (lnEndPos - lnStartPos)
' start minus end for total # of chars to grab....
'GetListing = Mid(Text6.Text, lnStartPos, lnNumber)
' grabs the actual proxy...
GetListing = Mid(Text6.Text, lnStartPos, lnNumber)
' set var to proxy here
Combo1.AddItem GetListing
' Combo1.Text = GetListing + vbCrLf
' load same into dropdown combo list...
lnStartPos = lnEndPos
' set starting point at new ending point...
GetListing = ""
Next r
I do not know how else to ask for the single vb term that will REJECT this item from the list, and go then go and search for the next item...
While I appreciate no end the help here, everyone has missed the point....
Jim