I have encountered a rather disconcerting error in my current model. When running a specific code loop, the script quits unexpectedly with an exception when using continue. I thought it might be due to some of these weird errors and faulty behavior that creeps in over time when making large models, so I copied a few tables and the script to a new model, but the same thing occurred.
Please see the attached model: The script in the scripting window runs a loop with two if (expression) continue; clauses in them. But at certain points the code quits when reaching these continue clauses. Not only is it a problem in this specific code, but it shakes my trust in the overall stability of flexsim coding. What if similar behavior happens in other places?
The error occurs on line 30 after the loop has run to 944 iterations, so to catch it a break point is set on line 14. What is really strange is that if I comment line 18 (it does nothing in the script logic anyway) the error starts occurring on every iteration but on line 22 instead.