Kirix Support Forums

Exit for Loop

Please post any help questions, requests or other feedback here.

Exit for Loop

Postby abenitez77 on Wed Mar 21, 2012 7:08 pm

I have a for loop within a for loop and in the 2nd loop (the inside loop), if a certain criteria is met, I want to go to the end of the for loop so it can loop to the next value...instead of falling thru and executing the rest of my code. How can i do this? Currently, I am using break, but this is not skipping the current step in the loop, it is exiting the loop.


for (i in selected_items2)
{
for (x in selected_items)
{
....
....
var TblExists = db3.execute("SELECT Table_Name FROM information_schema.tables Where Table_Name = '" + selected_items[x] + "'");
if (TblExists.hasNext())
{

}
else
{
alert("Table - " + selected_items[x] + " Not in " + selected_items2[i]);
break;
}
.....
....
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Return to Strata Help & Feedback