Skip to content

Defining New Data Types Inline

When adding methods and properties 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, method return types, or property 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 method or property is to be created and using that newly defined enum.

Creating an enum when defining a method or property

Section titled “Creating an enum when defining a method or property”

As an example of creating a new enum when defining a method, after executing the Add Method command, and while still in edit mode, the following text can be used to create a ConfigureTrigger method that returns a newly created TriggerSource enum.

ConfigureTrigger : 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:

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

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

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