question

Vallaban G avatar image
0 Likes"
Vallaban G asked Natalie White commented

How to use goto statement in flexscript ?

I want to move out from a particular loop (nested loops), therefore i preferred to choose goto statement. but in flexscript it is not working. Need an idea of how to use goto statement in flexscript

FlexSim 23.1.2
flexscript coding
· 2
5 |100000

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

Natalie White avatar image Natalie White commented ·

Hi @Vallaban G,

It's hard to know how to help without looking at your model. To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·
Natalie White avatar image Natalie White commented ·

Hi @Vallaban G, was one of Matthew Gillespie's or Joerg Vogel's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

The FlexScript language does not have a goto statement. You'd have to use some other method, like setting a flag and using break statements.

5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

Translate your code into custom source code blocks in Process Flow. Then you can create “goto“ statements by connections. If you use this extensively, you get spaghetti code which is often a result of “goto” statements.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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