so I have a web form with three radio buttons (labeled: Radio1, Radio2, RadioC)
I writing an automation to all calling projects to pass which option to press (along with other fields to populate on the form) Trying to make the call intuitive, the call looks something like:
Inside the function I have to figure which is the true item, ignoring the other two. The caller needs to pass all three, even though they are only interested in one of the three. I there a clean way to code this so we can pass one variable (not an index as no on will know what it means) to indicate which radio button to press...ex:
I thought about setting up an eNum in a script, but that has proved flaky at times... any suggestions are welcomed.... Rob....
There really isn't anything like an enum in the robotics projects that you can really substitute that I am aware of. I agree passing three (or more) values to get one is inefficient. When I wan to pass a lot of data, or data that varies, I store it in a lookup table (setup like a key value pair) and then you can either serialize it (use the JSONUtils component for this) to pass it around or use it from a global location. You'd still need a switch or a series of comparisons to evaluate the data though to take a specific action.
Posted: 2 years ago
Posted: 17 Jan 2020 14:44 EST
Robert Fleming (RobIsTheName)
Senior Manager, Process Automation