Optimize code inside a switch statement

I have some code such as:

a = Optimize(“a”,1,1,2,1);

Switch (a)
{
case 1:
code;
break;

case 2:
code …
x = optimize(“x”, 1,1,10,1);
break;

} // end switch

The optimize statement in case 2 executes even when case 2 is not selected. Is this normal or do I have something messed up?

This has been answered elsewhere on the forum.

2 Likes