Struct / Enum as Switch Data Type

You can use an enum or a struct as switch data type using a composition association. In this situation, the composition role is used as switch attribute for the union.



union Screen switch(Colors) {
 case red:
  short background;
 case blue:
  short foreground;
};

If you do not use the composition role as switch attribute, you still have to define a switch attribute in the Union.


Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com