question

martin.j avatar image
2 Likes"
martin.j asked Brandon Peterson answered

Can token labels be accessed via numeric index?

I am attempting to optimize the speed of my process flows and my code in general and have therefore decided to use direct adresseing on labels as much as possible. I have created macros to adress labels on my objects by index rather by name, but when I try to do the same thing on a Process Flow token it fails.

Am I correct in assuming that getlabel cannot use the labels index when accessing it on a token? Why is that?

getlabel(token, numeric_Label_Index);    vs.    getlabel(token, "MyLabel");
FlexSim 16.1.2
flexsim commandsprocess flowgetlabel
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

Brandon Peterson avatar image
3 Likes"
Brandon Peterson answered

Martin,

The answer is both yes and no. If you are using getlabel() on a flowitem, resource, or task executer then the answer is "yes". If you are using it on a token then the answer is "no". I do not know the reason for this but I would guess that it is do to how tokens access labels. The parent/child relationship that tokens are capable of introduces a number of complications that would make the numeric reference for a label unreliable.

I hope this clears things up for you,

Brandon

5 |100000

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