question

Steven Chen avatar image
2 Likes"
Steven Chen asked Phil BoBo edited

Use FlexScript to bring up custom exception

Hello,

Is there a command to can throw an exception manually?

I would like to terminate script executing if some condition fulfilled.

FlexSim 20.2.0
flexsim 20.2.0exception
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

You don't need to throw an exception to terminate script execution. Just return a value.

  1. if (someConditionFulfilled) {
  2. mpt("Error: some condition fulfilled\n");
  3. return 0;
  4. }
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.