With break keyword when used within a while, do…while, or for loop, the loop is terminated and execution continues from the statement following the loop as shown in the following example.
mainMenu = SysDictMenu::newMainMenu();
enum = mainMenu.getEnumerator();
found = false;
while (enum.moveNext())
{
menuItem = enum.current();
if (menuItem.label() == parentDictsecuritykey.label())
{
found = true;
break; //Use break to exit from loop
}
}
if (found) //Belongs in Navigation Pane.
{
...
}