|
May 11, 2002 Outside-the-Range Enum Values Tips: May 2002
Yehuda Shiran, Ph.D.
|
|
An enumerated variable can assume values outside the range of its declared values. This is convenient if you want to combine two values to create a third one which is not defined as a member. Let's assume we have the following enumeration:
The following line demonstrates a combination of the members NBC and FOX:
If you print the value of tvCombination above, you would get the value of 12 (the OR combination of 8 and 4).To learn more about JScript .NET, go to Column 108, JScript .NET, Part II: Major Features.
People who read this tip also read these tips: Look for similar tips by subject: |