Flexsim Version 2023.0.1 Flexscript Error

Flexsim Version 2023.0.1 Flexscript Error

lynsey_lingEFTAN
Explorer Explorer
87 Views
2 Replies
Message 1 of 3

Flexsim Version 2023.0.1 Flexscript Error

lynsey_lingEFTAN
Explorer
Explorer

[ FlexSim 23.0.1 ]

Hi, I have a model version 2018.2 have no issue on executing a switch case but the error prompting in version 2023. I tried version 2022, it prompted the same error, stated: "Switch statement cannot contain statements outside of a case."


The case function were coded at decision point upon on arrival by incoming item.


Code:

1673402899212.png


The Flexscript error:

1673402956140.png


Can help to check on this bug and any work around temporarily?

0 Likes
Accepted solutions (1)
88 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Explorer
Explorer
Accepted solution

Version 18.2 uses the switch case in the "Send By Case" option, whereas newer versions (not sure where exactly the change was made) use the if-statements instead, to allow for non-number case variables.

What likely happened:

You opened the old model in 23.0.1 which would keep the old code. However when you open the pick option's GUI, the code would update and replace the cases with the if-statements from the newer version, ending up with invalid syntax.

It would probably be best to delete the trigger and then add it again to fix the generated code.

Message 3 of 3

lynsey_lingEFTAN
Explorer
Explorer

Thanks for the help!

0 Likes