question

Patrick C4 avatar image
0 Likes"
Patrick C4 asked Jeanette F commented

What is the syntax to decide a label contains a specific letter?

Need to make a decide - if token.drawing contains "F" then 1, else 2. What is the correct syntax to do that?

FlexSim 21.1.2
flexsim 21.1.2conditional decidesyntax
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Patrick C4, was jason.lightfoot's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. 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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited
token.drawing.as(string).indexOf("F") 

will be -1 if not found and 0 to string length if found. See indexOf.

5 |100000

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