jdoran Posted March 1, 2012 Share Posted March 1, 2012 (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 March 6, 2012 by Guest Link to comment Share on other sites More sharing options...
Guest DanSpice Posted March 1, 2012 Share Posted March 1, 2012 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, Link to comment Share on other sites More sharing options...
jdoran Posted March 6, 2012 Author Share Posted March 6, 2012 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. Link to comment Share on other sites More sharing options...
dsturrock Posted March 8, 2012 Share Posted March 8, 2012 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. Link to comment Share on other sites More sharing options...
jdoran Posted March 8, 2012 Author Share Posted March 8, 2012 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. Link to comment Share on other sites More sharing options...
allysonfrancis Posted October 22, 2019 Share Posted October 22, 2019 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! Link to comment Share on other sites More sharing options...
Recommended Posts