continue or break command in if loop

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

continue or break command in if loop

odedm
hi all
i have a problem where i have nested if loops, nested within a for loop.
i would like it that when reaching the final if loop, although there is an error ("no selection") the macro would continue on and finish analysing all the files, some sort of flag, or continue action...

outline of the code:


for (i=0; i<filename.length; i++) {
        if(endsWith(filename[i], ".lsm")) {

Do stuff...        

if (Variable == 1) {
Do more stuff
if (no selection)  { //basicly an error - i would like to continue the analysis of all the files even though there was an error


print("no selection in"+ filename);
continue;


}//if no selection
}//if variable == 1
 
stuff i need to get done even in the case of error

}//if ends with lsm
}for number of files

 
Reply | Threaded
Open this post in threaded view
|

Re: continue or break command in if loop

odedm
up