Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Loop Without Do"?

Status
Not open for further replies.

mattster

Programmer
Apr 26, 2007
15
US
'Lo there... When running my ASP page, which should be working, I get this error:
===========================================================

Microsoft VBScript compilation error '800a040e'

'loop' without 'do'

/forum/test3.asp, line 112

Loop
^
==========================================================

And I DO have a DO statement. I don't understand why it is giving me this error
 
your code should look like

do
'your code here
loop while a < b

if it looks like that, then try posting your code. there's a chance that the error isn't coming from the loop

hope this helps
leo
 
actually, my code doesn't look like that

it's kind of like

do while a <b
'code here
loop

 
post your code, there's a good chance that the error isn't coming from the loop statement...

leo
 
well, i have a loop inside a loop... is that a &quot;no-no&quot;?
 
Loops nested inside other loops is fine. I'd do like PogoWolf suggested and make sure that you haven't forgotten an &quot;End If&quot; somewhere (or have one too many).

How pretty is your code? Do you have good indention going on? That's usually helpful in resolving these kinds of things. Another is getting into the habit of writing &quot;Sandwich&quot; code. As soon as you start a loop or conditional, close it with the appropiate statement before you start filling it in with your logic code. So if you do a for..next, write the For, and immediately write the Next, so you don't forget.

Chip H.
 
my indentations are fairly decent, I can understand it... But as far as I can see, all of my &quot;End If&quot;'s are there... I can post the code, but do you just want the section I'm having problems with, or the whole file? (It's about 130 lines)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top