UO
2007-09-10 08:51:24 UTC
Hi,
Is there a bug when debugging a switch/case?
If I debug a switch/case like below:
void __fastcall TForm1::Button1Click(TObject *Sender) //.
{
int x;
int y;
x = 1; //.
switch(x) //.
{
case 0:
y = 11; //.
break; //.
case 1:
y = 3; //.
break; //.
case 2:
y = 10; //.
break; //.
}
x = 3;
y = 4; //.
ShowMessage(IntToStr(x) + "," + IntToStr(y)); //.
} //.
only the lines marked with //. have a debug mark after the start of the
program.
The line "x = 3" is executed normally, but its debug line is not "x = 3", it
is the last break of the switch/case block.
If I comment out the last break, then the line "x = 3" has got a debug mark.
This is a bit confusing.
Should it be interpreted as a bug?
Thanks...
Is there a bug when debugging a switch/case?
If I debug a switch/case like below:
void __fastcall TForm1::Button1Click(TObject *Sender) //.
{
int x;
int y;
x = 1; //.
switch(x) //.
{
case 0:
y = 11; //.
break; //.
case 1:
y = 3; //.
break; //.
case 2:
y = 10; //.
break; //.
}
x = 3;
y = 4; //.
ShowMessage(IntToStr(x) + "," + IntToStr(y)); //.
} //.
only the lines marked with //. have a debug mark after the start of the
program.
The line "x = 3" is executed normally, but its debug line is not "x = 3", it
is the last break of the switch/case block.
If I comment out the last break, then the line "x = 3" has got a debug mark.
This is a bit confusing.
Should it be interpreted as a bug?
Thanks...