How to use goto statement in flexscript ?

How to use goto statement in flexscript ?

vallaban_g
Not applicable
231 Views
4 Replies
Message 1 of 5

How to use goto statement in flexscript ?

vallaban_g
Not applicable

[ FlexSim 23.1.2 ]

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

0 Likes
Accepted solutions (1)
232 Views
4 Replies
Replies (4)
Message 2 of 5

natalie_white
Not applicable

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
Message 3 of 5

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

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.



Matthew Gillespie
FlexSim Software Developer

Message 4 of 5

joerg_vogel_HsH
Mentor
Mentor

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.

0 Likes
Message 5 of 5

natalie_white
Not applicable

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