Skip to main content

Defining Enumerated Properties

Defining Enumerated Properties

Many properties support the parameters VALUELIST and DISPLAYLIST. You use these to define enumerated properties.

To specify a list of valid values for a property, use its VALUELIST parameter. The form of VALUELIST is a delimiter-separated list of logical values, where the delimiter is the first character. For instance:

Property Color As %String(VALUELIST = ",red,green,blue");

In this example, VALUELIST specifies that valid possible values are red, green, and blue, with a comma as its delimiter. Similarly,

Property Color As %String(VALUELIST = " red green blue");

specifies the same list, but with a space as its delimiter.

The property is restricted to values in the list, and the data type validation code simply checks to see if the value is in the list. If no list is present, there are no special restrictions on values.

DISPLAYLIST is an additional list that, if present, represents the corresponding display values to be returned by the LogicalToDisplay() method of the property.

For an example that shows how to obtain the display values, see Using Property Methods.

FeedbackOpens in a new tab