Set (property)

The set built-in data type is used to describe a set of properties that can occur in various combinations. Sets are distinguished from enumerations in that the values in sets can occur simultaneously whereas the values in enumerations can only occur one at a time.

= GLM =

To declare a set in a class, use the following syntax:

class my_class { set {A=1, B=2, C=4, D=8} my_set; } object my_class { my_set A|B|D; } object my_class { my_set BCD; }

= Note =

If all the members of the set are defined as being a single character, then the values of that set can be defined as a string combining those letters without separating, i.e., ABC to signify A+B+C. However, if even one of the members is a multi-letter value, then values of the set must defined using the or-syntax, i.e., A|B|C to signify A+B+C.

= See also =


 * enumeration
 * Built-in types