Visual Basic 2005 Enums

Enums are sets of named constants. PowerDesigner models enums as classes with a stereotype of <<Enum>>.

For information about creating and working with classes, see Classes (OOM).



Public Enum Day
 Monday
 Tuesday
 Wednesday
 Thursday
 Friday
 Saturday
 Sunday
 FirstDay = Monday
 LastDay = Sunday
End Enum

Creating an Enum

You can create an enum in any of the following ways:
  • Use the Enum tool in the Visual Basic 2005 Toolbox.

  • Select Model > Enum Objects to access the List of Enum Objects, and click the Add a Row tool.

  • Right-click the model (or a package) in the Browser, and select New > Enum.

Enum Properties

Visual Basic 2005 enum property sheets contain all the standard enum tabs along with the following properties, located on the VB tab:

Property

Description

Base Integral Type

Specifies the base integral type for the enum.

Compare

Specifies the Compare option directive for the enum declaration.

Explicit

Specifies the Explicit option directive for the enum declaration.

Shadows

Specifies that the enum redefines a enum defined in a parent enum .

Strict

Specifies the Strict option directive for the enum declaration.