954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

LOOP without DO

I've got a piece of code here, that was initially responsible for getting stuff out of a database, and into an array.
It used to do that fine, but after that, it needed to add another optional field.

However, when i try to run the code with the lines i commented out here, it gives me an LOOP without DO error

function switchAlgemeen()
{
	var algemeen  = new Array();
	var JS;
	<%
		sql1  = "SELECT DISTINCT * FROM HSE_TRA_risico_nieuw WHERE formtype = 'algemeen'"
		result = 0
		SET RS = Conn.Execute(sql1)     
		RS.MoveFirst
		Do While Not RS.EOF
			//if RS("fieldsRequired") > 0 THEN
				//Js = RS("JStrigger")
				//if RS("field1") <> " " THEN
					//%>
						//algemeen[<%=result%>] = '<input type="checkbox" id="<%=RS("risicoID")%> <%if not(isNull(JS)) THEN%> onclick = "<%=js%>" /> <%=RS("risico")%> '
						//algemeen[<%=result%>] = algemeen[<%=result%>] + '<div style="display:none;" id="<%=RS("risicoID")%>div">text <%=RS("field1")%> </div>'; 
					//<%
				//END IF
			//ELSE
				//(nothing here yet)
			//End If
			//%> algemeen[<%=result%>] = '<input type="checkbox" id="<%=RS("risicoID")%> /> <%=RS("risico")%> ';<%
			result = result + 1
			RS.MoveNext
		LOOP
	%>
}
phoenix_2000
Junior Poster
107 posts since Sep 2011
Reputation Points: 40
Solved Threads: 12
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You