Jump to content

Recommended Posts

Posted (edited)

I just want to make a label that outputs a list string, given a list state number. Similar to the Busy, Transporting, Failed list state types objects have.


E.G. Have a label over a vehicle, that says "Transporting" while it is moving, "Failed" when it has failed... etc.


The only way I can see how to do it, would be to make my own table, and do a search in it using the resource state number.


Will post back if I find it before someone else posts.

Edited by Guest
Guest DanSpice
Posted

That function does not currently exist. I have added it to our backlog, It should not be very difficult to implement.


Right now you can use Vehicle1[X].ResourceState (Where Vehicle1 is just an example vehicle name, and X signifies the population member) - or just 'ResourceState' if you are attaching the status label - but this returns the numerical value of the Resource State...for example 0 means Idle, 1 means Busy, etc.


You can manually convert these numeric values to words using an If statements similar to:


Math.If(ResourceState == 0, "Idle", ResourceState == 7, "Transporting", " Busy") <-In an attached label.



Thanks,

Posted
That function does not currently exist. I have added it to our backlog, It should not be very difficult to implement.


Right now you can use Vehicle1[X].ResourceState (Where Vehicle1 is just an example vehicle name, and X signifies the population member) - or just 'ResourceState' if you are attaching the status label - but this returns the numerical value of the Resource State...for example 0 means Idle, 1 means Busy, etc.


You can manually convert these numeric values to words using an If statements similar to:


Math.If(ResourceState == 0, "Idle", ResourceState == 7, "Transporting", " Busy") <-In an attached label.



Thanks,

I was afraid you would say that. Thanks anyway though. Looking forward to that feature.


In my instance, I have a list state of about 30states (last I checked). So this if statement is quite hefty, and a pain to update across all instances of the label.

Posted

In my instance, I have a list state of about 30states (last I checked). So this if statement is quite hefty, and a pain to update across all instances of the label.

While an If like Dan suggested but with 30 clauses would certainly be tedious to create, I think you could do it once in a Function, perhaps named StringState that returns the string. Then in all of your objects you simply reference StringState.

Posted
In my instance, I have a list state of about 30states (last I checked). So this if statement is quite hefty, and a pain to update across all instances of the label.

While an If like Dan suggested but with 30 clauses would certainly be tedious to create, I think you could do it once in a Function, perhaps named StringState that returns the string. Then in all of your objects you simply reference StringState.

That's a good work around. I had forgotten about functions in this kind of situation.

  • 7 years later...
Posted

I would like the above feature as well. Currently using the workarounds listed here but this feature would be quite useful. It would also be useful to be able to return the number of items in the list (something like List.ListName.NumberItems). Thanks!

×
×
  • Create New...