I do not think you can format the case selector to show leading zeros. Since only the programmer will see this, he or she will have to adapt to the display of 011 as 11. You can of course have case 0 as numeric.
Although I wonder, isn't there a a much more elegant way of indexing a case struct with mutually exclusive booleans?
This thread is NOT about mutually exclusive booleans, so you should probably have started a new thread. You have a very different problem!
Unfortunately, you don't show the inputs to your "in range & Coerce" functions, so we cannot tell what you are doing and we cannot really help.
Where do the mutually exclusive booleans come from? Is this from an instrument or from a user control?
So why don't you tell us a little bit more? Maybe there is a much simpler solution!
It's not a very big deal.
I'm writing a little program to build the spurious emissions mask limits for a point-to-point RF system.
So on the front panel I have two inputs, the Channel Spacing (CS) value, and the frequency carrier f_0 value, plus a parameter that in the final realease will not be an input but will be taken directly from the Spectrum Analyzer (the Max range of the SA).
There's a fourth param, the breakpoint (BP) frequency, which is the value on which the mask limits jump from -50 to -30 dBm.
So according to the ETSI spec I have 4 cases, mutually excluding:
Hence my issue with that "boolan driven" case struct.
Justto put my 2 cents in... regarding to the original subject with multiple Case inputs, I prefer the solution shown in the attached pictures. It uses the type cast function to cast the U32 values to an Enum (which MUST be of U32). This makes it more readible to the programmer.
Enum- Items in Order:
C B A Yellow Red Pink Blue
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1