P
PeterZ
Hi,
Back to basics!
My understanding is that the only way to exit a For-Next loop prematurely is
with the 'break' keyword. How are you supposed to do that if you're inside
a Switch statement? The break keyword will only come out of the switch, not
the for-next loop.
for (int i=0; i<=myArray.Length; i++)
{
if (myArray == true)
switch (i)
{
case 0 :
... do somehting
exit the for loop;
case 1 :
... do somehting
exit the for loop;
case 2 :
... do somehting
exit the for loop;
}
}
Cheers,
PeterZ
Back to basics!
My understanding is that the only way to exit a For-Next loop prematurely is
with the 'break' keyword. How are you supposed to do that if you're inside
a Switch statement? The break keyword will only come out of the switch, not
the for-next loop.
for (int i=0; i<=myArray.Length; i++)
{
if (myArray == true)
switch (i)
{
case 0 :
... do somehting
exit the for loop;
case 1 :
... do somehting
exit the for loop;
case 2 :
... do somehting
exit the for loop;
}
}
Cheers,
PeterZ