03-02-2012 11:00 AM
In the past, I've always used strings to pass states from one loop iteration to the next. I'd like to try doing that numerically, with a Ring or similar to avoid problems with typos in my strings. However, when I set it up with a ring, each case only shows the Ring number, not the text description. Is there a way to set up a numerically-based case structure that shows a text description for each case? Thanks!
Solved! Go to Solution.
03-02-2012 11:07 AM
Ahah! Replaced the ring constant with an Enum constant, and everything works beautifully now. Never mind.
03-02-2012 11:08 AM
Is there a specific function you're looking for with Ring (do you need the number for something), or could you just use a type def Enum?
03-02-2012 11:36 AM
@diarmaede wrote:
Ahah! Replaced the ring constant with an Enum constant, and everything works beautifully now. Never mind.
I'll still mind to help you with the question you will have soon.
Save the enum as a type def then replace all of the constants of that enum with the type-def'd version. By using a type def, you can edit the type def to add new values and all instanses will automatically adapt. WIth a plain enum, if you edit one instance and not the others, you will be back in number land again.
Ben
TO save as type def...
click-click create control
Goto FP and right-click new enum control and chose advanced customize.
In Control editor change drop down from "Control" to "type def".
Save
Replace
Find terminal id diagram and choose convert to constant
03-02-2012 12:26 PM
Thanks Ben. I modified my code per your suggestion!