Click or drag to resize

Defining New Data Types Inline

When adding functions and attributes to a driver, it can be convenient to create the data types needed at the same time the method or property itself is being defined. Nimbus allows enums to be created and defined when entering new parameters, attribute types, or callback function return types. This is simpler than defining an enum ahead of time in one portion of the Driver Designer and then returning to where the desired function or attribute is to be created and using that newly defined enum.

Creating an enum when defining a function or attribute

As an example of creating a new enum when defining an attribute, after executing the Add Attribute command, and while still in edit mode, the following text can be used to create a StartTrigger attribute using a newly created TriggerSource enum. enum.

StartTrigger : new enum TriggerSource

In addition to creating the enum, the enum members can be defined at the same time as the enum, as in the following:

StartTrigger : new enum TriggerSource; Internal = 2, External = 0x15, Software = 47

The above example creates a new TriggerSource enum with three member, each with member numeric values specified.

See the Shorthand section of the Adding an Enumeration topic for details on enum creation shorthand.

Tip Tip

The syntax for creating new enums inline can be used in the driver designer tree view for method return types, parameter types, and property types. It can also be used in the Type text boxes in the item editors for those items.

See Also

Other Resources

Download a complete CHM version of this documentation here.