question

Kari Payton avatar image
0 Likes"
Kari Payton asked Matthew Gillespie commented

Conditional Decide with token label

I have a token label called "destination" that reads "DW_1 Mold".

I wanted to put a conditional decide if it reads that string then send to connector 1. But, when I run the program it sends to connector 2. Any ideas what I am doing wrong?

FlexSim 16.1.2
conditional decide
screenshot-2.png (35.5 KiB)
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

Steven Hamoen avatar image
2 Likes"
Steven Hamoen answered Matthew Gillespie commented

I could be mistaken but to me it looks like your destination is not a string but a pointer to an object. So I think that getname( getlabel( token, "destination" ) ) == "DW_1 Mold" might do the trick

· 6
5 |100000

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

Kari Payton avatar image Kari Payton commented ·

You were correct @steven.hamoen. It pointed to a label on an object.

0 Likes 0 ·
Kari Payton avatar image Kari Payton commented ·

@steven.hamoen @Adrian Haws

do you know how to write getname( getlabel( token, "bayLocation" ) ) with the dot syntax in FlexSim 2017?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Kari Payton commented ·

token.bayLocation.name

I would only use token.labels["labelName"] if your label has spaces in the name or you're using a variable to hold the label name.

1 Like 1 ·
Steven Hamoen avatar image Steven Hamoen Kari Payton commented ·

@Kari Payton try getname( token.labels["NameOfLabel"] )

0 Likes 0 ·
Kari Payton avatar image Kari Payton Steven Hamoen commented ·

@steven.hamoen

the user manual says 'getname' is obsolete now. the way it is getname( getlabel( token, "bayLocation" ) ) works. I was just wondering how to rewrite with the new update.

0 Likes 0 ·
Show more comments