PDA

View Full Version : 4.5 bug with switch statement


Anthony Johnson
02-10-2009, 05:38 PM
In version 4.5 we have found a bug with the new flexscript parser regarding switch statement. The following code will not execute properly:


switch(33)
{
case 1: pt("1");break;
case 33: pt("33");break;
}


The switch statement never hits case 33. The bug will only happen if you use very disparate case values, meaning the bug doesn't happen if you include all cases from 1 to 33, but will happen if you just use cases 1 and 33, or cases 1, 2, and 33, etc. The problem is that the parser uses a hash table for case lookup, and it is not properly finding the index of additional entries for cases that share the same hash table index. Anyway, if your models have this problem, you can extract the attached flexsimrunner.exe into your Flexsim4\program directory.

We hope to have a bug-fix release ready by the end of February, which will include this fix.