Skip to main content

Using a Value List

The Rating property has a limited set of predefined values: “G”, “PG”, “PG-13”, or “R”. Caché will enforce this restriction automatically if we use the VALUELIST parameter.

Here's what we do. First, using the New Property Wizard, we create the property, giving it a name generated description: little1.gif and data type generated description: little2.gif. We then click Next on the Characteristics page.

generated description: filmrating1 20111

This brings us to the Parameters page of the Wizard where we fill in the VALUELIST parameter generated description: little3.gif. Note that we have used commas here to separate the values. You can use whatever delimiter character you want, but it must be the first character in the parameter value. (If you forget this—as I often do—you will get “unexpected” results. Here, for instance, if we entered a VALUELIST of “G,PG,PG-13,R”, Caché will think that “G” is the separator. As a result, permitted values would be “,P”, “,P”, and “-13,R”.)

FeedbackOpens in a new tab