We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.

Ansys Learning Forum Forums Discuss Simulation Photonics escaping double for loop using break Reply To: escaping double for loop using break

Amrita Pati
Ansys Employee

Hi Lee Seung,

I believe there is no way to skip an iteration. But I agree, that it will be very helpful have a script command like that, I remember using functions like "continue" in C++. I will recommend you to submit a feature request on IX: Ideas Exchange.

In the mean time, we can try and find a workaround. I didn't fully understand the condtions, so please feel free to elaborate a little bit. But I am thinking if we can use something like this as a workaround:

flag=0;
for (i=1:1:3){
for(j=1:1:5){
if(j==1 or j==4){#Run only if certain j conditions are met
flag=1;
?flag;}

else{#else do nothing

}
}
}

Regards,
Amrita