Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript switch within for-loop break; conflicts
    primarykey
    data
    text
    <p>I have switch nested with loop in JavaScript like:</p> <pre><code>for (var i = 0; i &lt; checkBoxIds.length; i++) { if ($('#' + checkBoxIds[i]).prop('checked')) { var id = checkBoxIds[i]; var assetCat = id.substring(0, 4); switch (id.substring(id.length - 3)) { case "scr": if (!sscripts) if (confirm("Name of scripts sub-folder (in shared) is not provided for " + assetCat + ". Press OK to Continue for others?")) continue; else break; //else return //Appending chrs or sets or props to scripts switchAssets(sscripts, IdEnum.SCRIPTS); break; case "shd": if (!sshaders) if (confirm("Name of shaders sub-folder (in shared) is not provided for " + assetCat + ". Press OK to Continue for others?")) continue; else break; //else return //Appending chrs or sets or props to shaders switchAssets(sshaders, IdEnum.SHADERS); break; case "sim": if (!ssourceimages) if (confirm("Name of sourceimages sub-folder (in shared) is not provided for " + assetCat + ". Press OK to Continue for others?")) continue; else break; //else return //Appending chrs or sets or props to sourceimages switchAssets(ssourceimages, IdEnum.SOURCEIMAGES); break; default: } } } //...Still doing something (else return; will never kiss this :D ) } </code></pre> <p>if <em>!sscripts</em> is falsy, i am asking user to if want to continue for other check-boxes, if he cancels, i want to break the loop and execute remaining statements within a function. Seems like break; within confirm dialog executing for switch, how can i make it to run for for-loop. </p> <p>Any suggestions will be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload